catch error Client certificate revoked and pass error.session-expired. Graph QL error: always passed from backend

This commit is contained in:
ogerly 2021-12-03 13:09:45 +01:00
parent 1605cea902
commit fb48e7c9d2
4 changed files with 6 additions and 4 deletions

View File

@ -48,7 +48,7 @@
"error": "Fehler",
"no-account": "Leider konnten wir keinen Account finden mit diesen Daten!",
"no-email-verify": "Die Email wurde noch nicht bestätigt, bitte überprüfe deine Emails und klicke auf den Aktivierungslink!",
"session-expired": "Sitzung abgelaufen!"
"session-expired": "Die Sitzung wurde aus Sicherheitsgründen beendet."
},
"form": {
"amount": "Betrag",

View File

@ -48,7 +48,7 @@
"error": "Error",
"no-account": "Unfortunately we could not find an account to the given data!",
"no-email-verify": "Your email is not activated yet, please check your emails and click the activation link!",
"session-expired": "The session expired"
"session-expired": "The session was closed for security reasons."
},
"form": {
"amount": "Amount",

View File

@ -24,7 +24,7 @@ const authLink = new ApolloLink((operation, forward) => {
})
return forward(operation).map((response) => {
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)
if (router.currentRoute.path !== '/login') router.push('/login')
return response

View File

@ -133,7 +133,9 @@ export default {
})
.catch((error) => {
this.pending = true
this.$toasted.error(error.message)
if (error.message === 'GraphQL error: 403.13 - Client certificate revoked') {
this.$toasted.error(this.$t('error.session-expired'))
}
// what to do when loading balance fails?
})
},