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 },
|
components: { defaultLayout },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
showLayout: CONFIG.DEBUG_DISABLE_AUTH || this.$store.state.token
|
showLayout: CONFIG.DEBUG_DISABLE_AUTH || this.$store.state.token,
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -50,9 +50,9 @@ export default {
|
|||||||
this.$router.push('/logout')
|
this.$router.push('/logout')
|
||||||
},
|
},
|
||||||
wallet() {
|
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
|
this.$store.dispatch('logout') // logout without redirect
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -19,12 +19,11 @@ const environment = {
|
|||||||
|
|
||||||
const endpoints = {
|
const endpoints = {
|
||||||
GRAPHQL_URI: process.env.GRAPHQL_URI || 'http://localhost:4000/graphql',
|
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 = {
|
const debug = {
|
||||||
DEBUG_DISABLE_AUTH: process.env.DEBUG_DISABLE_AUTH === 'true' || false
|
DEBUG_DISABLE_AUTH: process.env.DEBUG_DISABLE_AUTH === 'true' || false,
|
||||||
}
|
}
|
||||||
|
|
||||||
const options = {}
|
const options = {}
|
||||||
|
|||||||
@ -1,11 +1,12 @@
|
|||||||
import CONFIG from "../config"
|
import CONFIG from '../config'
|
||||||
|
|
||||||
const addNavigationGuards = (router, store) => {
|
const addNavigationGuards = (router, store) => {
|
||||||
// store token on `authenticate`
|
// store token on `authenticate`
|
||||||
router.beforeEach((to, from, next) => {
|
router.beforeEach((to, from, next) => {
|
||||||
if (to.path === '/authenticate' && to.query.token) {
|
if (to.path === '/authenticate' && to.query.token) {
|
||||||
store.commit('token',to.query.token)
|
// TODO verify user to get user data
|
||||||
next({path: '/'})
|
store.commit('token', to.query.token)
|
||||||
|
next({ path: '/' })
|
||||||
} else {
|
} else {
|
||||||
next()
|
next()
|
||||||
}
|
}
|
||||||
@ -13,11 +14,12 @@ const addNavigationGuards = (router, store) => {
|
|||||||
|
|
||||||
// protect all routes but `not-found`
|
// protect all routes but `not-found`
|
||||||
router.beforeEach((to, from, next) => {
|
router.beforeEach((to, from, next) => {
|
||||||
if (!CONFIG.DEBUG_DISABLE_AUTH && // we did not disabled the auth module for debug purposes
|
if (
|
||||||
|
!CONFIG.DEBUG_DISABLE_AUTH && // we did not disabled the auth module for debug purposes
|
||||||
!store.state.token && // we do not have a token
|
!store.state.token && // we do not have a token
|
||||||
to.path !== '/not-found' && // we are not on `not-found`
|
to.path !== '/not-found' && // we are not on `not-found`
|
||||||
to.path !== '/logout') { // we are not on `logout`
|
to.path !== '/logout' // we are not on `logout`
|
||||||
console.log(!CONFIG.DEBUG_DISABLE_AUTH,!store.state.token,to.path !== '/not-found',to.path !== '/logout')
|
) {
|
||||||
next({ path: '/not-found' })
|
next({ path: '/not-found' })
|
||||||
} else {
|
} else {
|
||||||
next()
|
next()
|
||||||
|
|||||||
@ -16,7 +16,7 @@ export const mutations = {
|
|||||||
},
|
},
|
||||||
token: (state, token) => {
|
token: (state, token) => {
|
||||||
state.token = token
|
state.token = token
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
export const actions = {
|
export const actions = {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user