Router interceptor and Authentication
See original GitHub issueHey 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.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.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.