Skip to content

Redirect back to initial route after signin #255

Answered by manchenkoff
martijnhalekor asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @martijnhalekor, yes, it is possible if specific-route requires authentication. You can set sanctum.redirect.keepRequestedRoute to true in your nuxt.config.ts and it will keep this URL in query params for redirect back to it once credentials are sent.

In other cases, it is better to set the onLogin route to false and handle it in your code if you want to use a dynamic value.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by manchenkoff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants