[auth-next] feat: $auth.goToLogin -- navigate to login route and redirect on success #1477
replygirl
started this conversation in
Ideas & Feature Requests
Replies: 1 comment
-
Thanks @hidekatsu-izuno's mounted() {
const to =
this.$historyState.getItem?.(Math.max(this.$historyState._page - 1, 0))
?.location?.path ?? '/'
this.$auth.options.redirect.home = to.startsWith('/login') ? '/' : to
}, |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is your feature request related to a problem? Please describe.
Many auth-guarded components are not directly associated with routes.
Describe the solution you'd like to see
A method call that routes directly to the provided
login
route--as if the user had tried to access a guarded route--would let us rely exclusively on$auth
for simple guards.Describe alternatives you've considered
As I understand, best practice (and my go-to) is a handler that either:
from
parameterthis.$router.back
.Beta Was this translation helpful? Give feedback.
All reactions