-
Notifications
You must be signed in to change notification settings - Fork 150
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
Handle unauthenticated request #775
Comments
Hey, thanks for raising this! Just to help me understand the problem better, could you please clarify:
If it's number 2, and you simply want to override the One option would be to skip the Hope this helps! |
Hi Paulo, Thanks for the quick reply and it was also nice to meet you at Editions. It's neither of those, it's that I would like to choose my own routes. I'd like to do an auth check on the index route. If they are not logged in, redirect to a different login route other than In the index route, If I add the auth check to the loader I found that if not authenticated, it performs the redirect to
It would be great if I could pass in an additional parameter to Then I can create my own routes rather than being restricted to It would also be useful for API endpoints, where you don't necessarily need a redirection. |
I see, I think that's a great point - so you basically want to be able to call the authentication but handle the failure cases yourself. I like the idea, but it's worth pointing out that there are quite a few edge cases in that authentication that we need to be mindful of, so we'd need to do some thinking on it. In any case, I'll bring it to the team and get back to you! |
The template does not have any configuration settings for the login route.
It automatically redirects to
auth/login
. I would like to specify my own route to an unauthenticated page or have it just return unauthenticated so I can handle my own logic if a user is not authenticated.const { admin } = await authenticate.admin(request);
The text was updated successfully, but these errors were encountered: