Skip to content

Commit

Permalink
Fix redirection to login on first run
Browse files Browse the repository at this point in the history
  • Loading branch information
BitK committed Oct 28, 2021
1 parent 2eaf6cf commit 61a85c7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dockers/manager/front/src/apollo/apollo-client-hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ const AuthLink = new ApolloLink((operation, forward) => {
const ErrorLink = onError(({ graphQLErrors = [] }) => {
graphQLErrors.forEach(({ message }) => {
if (message === "Unauthorized") {
router.push("/login");
const route = router.match(document.location.pathname)
if (!route.meta.public){
router.push("/login");
}
}
Notify.create({
message,
Expand Down
2 changes: 2 additions & 0 deletions dockers/manager/front/src/router/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ const routes = [
name: "login",
meta: {
hideMenu: true,
public: true,
},
component: () => import("pages/Login.vue")
},
Expand All @@ -169,6 +170,7 @@ const routes = [
name: "firstRun",
meta: {
hideMenu: true,
public: true,
},
component: () => import("pages/FirstRun.vue")
},
Expand Down

0 comments on commit 61a85c7

Please sign in to comment.