mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
renew token
This commit is contained in:
parent
d894358426
commit
6a404841ed
@ -32,18 +32,17 @@ const authLink = new ApolloLink((operation, forward) => {
|
|||||||
Authorization: token && token.length > 0 ? `Bearer ${token}` : '',
|
Authorization: token && token.length > 0 ? `Bearer ${token}` : '',
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
return forward(operation)
|
return forward(operation).map((response) => {
|
||||||
/* .map((response) => {
|
|
||||||
if (response.errors && response.errors[0].message === '403.13 - Client certificate revoked') {
|
if (response.errors && response.errors[0].message === '403.13 - Client certificate revoked') {
|
||||||
response.errors[0].message = i18n.t('error.session-expired')
|
response.errors[0].message = i18n.t('error.session-expired')
|
||||||
store.dispatch('logout', null)
|
store.dispatch('logout', null)
|
||||||
if (router.currentRoute.path !== '/login') router.push('/login')
|
if (router.currentRoute.path !== '/not-found') router.push('/not-found')
|
||||||
return response
|
return response
|
||||||
}
|
}
|
||||||
const newToken = operation.getContext().response.headers.get('token')
|
const newToken = operation.getContext().response.headers.get('token')
|
||||||
if (newToken) store.commit('token', newToken)
|
if (newToken) store.commit('token', newToken)
|
||||||
return response
|
return response
|
||||||
}) */
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
const apolloClient = new ApolloClient({
|
const apolloClient = new ApolloClient({
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user