diff --git a/frontend/src/components/SidebarPlugin/SideBar.vue b/frontend/src/components/SidebarPlugin/SideBar.vue index d8b26318f..8277b17eb 100755 --- a/frontend/src/components/SidebarPlugin/SideBar.vue +++ b/frontend/src/components/SidebarPlugin/SideBar.vue @@ -122,7 +122,7 @@ export default { this.$emit('logout') }, admin() { - window.location = CONFIG.ADMIN_AUTH_URL.replace('$1',this.$store.state.token) + window.location = CONFIG.ADMIN_AUTH_URL.replace('$1', this.$store.state.token) this.$store.dispatch('logout') // logout without redirect }, getElopageLink() { diff --git a/frontend/src/config/index.js b/frontend/src/config/index.js index 0f8e58c1c..b3a9366b7 100644 --- a/frontend/src/config/index.js +++ b/frontend/src/config/index.js @@ -20,8 +20,7 @@ const environment = { const endpoints = { GRAPHQL_URI: process.env.GRAPHQL_URI || 'http://localhost:4000/graphql', - // TODO port - ADMIN_AUTH_URL: process.env.ADMIN_AUTH_URL || 'http://localhost/admin/authenticate?token=$1' + ADMIN_AUTH_URL: process.env.ADMIN_AUTH_URL || 'http://localhost/admin/authenticate?token=$1', } const options = {} diff --git a/frontend/src/routes/guards.js b/frontend/src/routes/guards.js index bb55ba0cf..005ed720f 100644 --- a/frontend/src/routes/guards.js +++ b/frontend/src/routes/guards.js @@ -11,16 +11,15 @@ const addNavigationGuards = (router, store) => { // store token on authenticate router.beforeEach((to, from, next) => { - console.log('token', to.path, from.path, to.query) if (to.path === '/authenticate' && to.query.token) { - console.log('token', to.query.token, to) - store.commit('token',to.query.token) - next({path: '/overview'}) + // TODO verify user in order to get user data + store.commit('token', to.query.token) + next({ path: '/overview' }) } else { next() } }) - + // handle authentication router.beforeEach((to, from, next) => { if (to.meta.requiresAuth && !store.state.token) {