Redirect back to initial route after signin #255
-
Hey! I was wondering if it's possible to configure the following behaviour:
Currently, I always end up at It feels like I'm looking for something this package alone can't provide, but any tips or examples are greatly appreciated 🙏 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey @martijnhalekor, yes, it is possible if In other cases, it is better to set the |
Beta Was this translation helpful? Give feedback.
Hey @martijnhalekor, yes, it is possible if
specific-route
requires authentication. You can setsanctum.redirect.keepRequestedRoute
totrue
in yournuxt.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 tofalse
and handle it in your code if you want to use a dynamic value.