-
-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Redirect URL/route for un-authenticated users #45
Comments
Hi @awaisalwaisy, Currently there is no built in way to redirect users to a specific URL when they are unautnticated accessing routes that you want to be protected. This can however be achieved by a simple custom middleware. If you add a file into the
Then at the top of your
Let me know if this helps. |
Thanks for replying... I have implemented the following code by copying and modifying the middleware from the "kinde auth" module. It successfully worked for my needs. Here is the code snippet from my global middleware file,
Although this solution works, I believe there could be a better built-in way to handle this situation. |
@awaisalwaisy Have a nice solution for this incoming. |
I just visited the reference PR. Better solution to protect routes. |
I hope this will be merged very soon. |
I am having some difficulty handling unauthenticated users. I attempted to use another global middleware, but encountered an infinite redirect error. Is there a redirect URL available for unauthenticated users similar to Clerk auth?
The text was updated successfully, but these errors were encountered: