Skip to content

Commit e01a17d

Browse files
author
Francisco Aranda
committed
fix(ui): redirect full path after login (#161)
1 parent 901d492 commit e01a17d

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

frontend/middleware/auth-guard.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
export default ({ $auth, route, redirect }) => {
2-
if (!route.path.includes("/login")) {
3-
if (!$auth.loggedIn) {
4-
const REDIRECT_URL = "/login?redirect=" + route.path;
5-
redirect(REDIRECT_URL);
6-
}
2+
switch (route.path) {
3+
case "/login":
4+
break;
5+
default:
6+
if (!$auth.loggedIn) {
7+
const REDIRECT_URL = "/login?redirect=" + route.fullPath;
8+
redirect(REDIRECT_URL);
9+
}
710
}
811
};

0 commit comments

Comments
 (0)