mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
lint admin
This commit is contained in:
parent
7ba1ec8482
commit
df74427c39
@ -14,8 +14,8 @@ export default {
|
||||
components: { defaultLayout },
|
||||
data() {
|
||||
return {
|
||||
showLayout: CONFIG.DEBUG_DISABLE_AUTH || this.$store.state.token
|
||||
showLayout: CONFIG.DEBUG_DISABLE_AUTH || this.$store.state.token,
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -50,9 +50,9 @@ export default {
|
||||
this.$router.push('/logout')
|
||||
},
|
||||
wallet() {
|
||||
window.location = CONFIG.WALLET_AUTH_URL.replace('$1',this.$store.state.token)
|
||||
window.location = CONFIG.WALLET_AUTH_URL.replace('$1', this.$store.state.token)
|
||||
this.$store.dispatch('logout') // logout without redirect
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -19,12 +19,11 @@ const environment = {
|
||||
|
||||
const endpoints = {
|
||||
GRAPHQL_URI: process.env.GRAPHQL_URI || 'http://localhost:4000/graphql',
|
||||
// TODO port
|
||||
WALLET_AUTH_URL: process.env.WALLET_AUTH_URL || 'http://localhost/vue/authenticate?token=$1'
|
||||
WALLET_AUTH_URL: process.env.WALLET_AUTH_URL || 'http://localhost/vue/authenticate?token=$1',
|
||||
}
|
||||
|
||||
const debug = {
|
||||
DEBUG_DISABLE_AUTH: process.env.DEBUG_DISABLE_AUTH === 'true' || false
|
||||
DEBUG_DISABLE_AUTH: process.env.DEBUG_DISABLE_AUTH === 'true' || false,
|
||||
}
|
||||
|
||||
const options = {}
|
||||
|
||||
@ -16,4 +16,4 @@ export default {
|
||||
FooTer,
|
||||
},
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
import CONFIG from "../config"
|
||||
import CONFIG from '../config'
|
||||
|
||||
const addNavigationGuards = (router, store) => {
|
||||
// store token on `authenticate`
|
||||
router.beforeEach((to, from, next) => {
|
||||
if (to.path === '/authenticate' && to.query.token) {
|
||||
store.commit('token',to.query.token)
|
||||
next({path: '/'})
|
||||
// TODO verify user to get user data
|
||||
store.commit('token', to.query.token)
|
||||
next({ path: '/' })
|
||||
} else {
|
||||
next()
|
||||
}
|
||||
@ -13,11 +14,12 @@ const addNavigationGuards = (router, store) => {
|
||||
|
||||
// protect all routes but `not-found`
|
||||
router.beforeEach((to, from, next) => {
|
||||
if (!CONFIG.DEBUG_DISABLE_AUTH && // we did not disabled the auth module for debug purposes
|
||||
!store.state.token && // we do not have a token
|
||||
to.path !== '/not-found' && // we are not on `not-found`
|
||||
to.path !== '/logout') { // we are not on `logout`
|
||||
console.log(!CONFIG.DEBUG_DISABLE_AUTH,!store.state.token,to.path !== '/not-found',to.path !== '/logout')
|
||||
if (
|
||||
!CONFIG.DEBUG_DISABLE_AUTH && // we did not disabled the auth module for debug purposes
|
||||
!store.state.token && // we do not have a token
|
||||
to.path !== '/not-found' && // we are not on `not-found`
|
||||
to.path !== '/logout' // we are not on `logout`
|
||||
) {
|
||||
next({ path: '/not-found' })
|
||||
} else {
|
||||
next()
|
||||
|
||||
@ -16,7 +16,7 @@ export const mutations = {
|
||||
},
|
||||
token: (state, token) => {
|
||||
state.token = token
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
export const actions = {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user