Skip to content

Commit 0386eb9

Browse files
SnooHDpi0
authored andcommitted
fix(watch loggedIn): disable redirect on direct page loads (#158)
1 parent 8275e60 commit 0386eb9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/core/auth.js

+5
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ export default class Auth {
2727
if (process.browser) {
2828
this.$storage.watchState('loggedIn', loggedIn => {
2929
if (!routeOption(this.ctx.route, 'auth', false)) {
30+
//disable redirect on refresh / direct load of a page.
31+
if(loggedIn && !this.ctx.from) {
32+
return
33+
}
34+
3035
this.redirect(loggedIn ? 'home' : 'logout')
3136
}
3237
})

0 commit comments

Comments
 (0)