Skip to content

Commit 74ec84a

Browse files
committed
fix: issue with redirect from login not working for routes with parameters in their urls
1 parent 245d3aa commit 74ec84a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/router/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,11 +208,13 @@ router.beforeEach(to => {
208208
BanStore.initBanNotice(localStorageAuth().data)
209209

210210
// Redirect to login page if route has meta.requiresAuth set
211+
console.log(to)
212+
211213
if (to.meta.requiresAuth && !localStorageAuth().data.token) {
212214
router.push({
213215
name: 'Login',
214216
params: {
215-
redirectName: to.name || 'Boards',
217+
fullPath: to.fullPath || '/',
216218
redirectParams: JSON.stringify(to.params), // Cannot pass object, gets converted to string
217219
redirectQuery: JSON.stringify(to.query),
218220
},

0 commit comments

Comments
 (0)