question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Router interceptor and Authentication

See original GitHub issue

Hey I’m a complete newbie in docusaurus and I am loving it ❤️

We have a private document that we want to publish it and make it accessible to our members but we need some sort of authentication even the most simple one with a hard coded username and password…

I made a simple front-end login page and I managed to get it working only for FIRST page which is the main one in the classic theme.

Seems like when user goes to directly to one of the doc page route bypasses the main page…

I was wondering if there is any API to intercept and play around with the router by using the classic theme itself. I do not want to eject or extract the theme itself and go into rabbit whole of how classic theme made and etc.

image

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
lex111commented, May 31, 2020

We are using a react-router and as far as I know there is no route guard, so the only and best option is using a proxy server or similar feature provided by your hosting provider.

2reactions
amimascommented, May 30, 2020

I think you may have better luck with looking into actual deployment platform. Otherwise, you’re changing the internal behaviour of Docusaurus linking. That can make it difficult to upgrade your instance of Docusaurus, unless there’s a way to do it properly.

I deployed my site in AWS (S3 + CloudFront). Plus WAF service linked to the CloudFront made it possible so that the site is only available from certain IP addresses. You can also integrate single sign on services with CloudFront. It all depends on how and where you’re deploying the site.

Hope that helps.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular Authentication, Interceptors and Guards | by AG Dev
In this article I will create step by step an Authentication library and along the way will describe Interceptors and Guards.
Read more >
Protected Routes and Authentication with React Router - ui.dev
In this up-to-date guide, you'll learn a pattern for adding protected routes to your React Router application.
Read more >
Part 7 - Routing and interceptors - Duncan Hunter
1.Add a lib for a users profile page. Add a lazy loaded lib with routing. · 2. Add a method in the subscription...
Read more >
how to prevent Angular from showing route when using an ...
I'm using an http interceptor to check for user authentication (JWT, etc.) in Angular 6. My implementation is very similar to what is ......
Read more >
Angular CanActivate vs. Interceptors— A Comprehensive Guide
Instead of responding directly to the Angular Router, we can authenticate the URL invocation using a web service. Then we have two common ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found