Show errors from openid provider
This commit is contained in:
parent
7bd081efe0
commit
f79f4101b6
3 changed files with 13 additions and 2 deletions
|
@ -62,7 +62,7 @@ export default {
|
||||||
return state.namespaces.namespaces.filter(n => !n.isArchived)
|
return state.namespaces.namespaces.filter(n => !n.isArchived)
|
||||||
},
|
},
|
||||||
currentList: CURRENT_LIST,
|
currentList: CURRENT_LIST,
|
||||||
background: 'background',
|
background: 'background', // FIXME: Return the full thing or nothing at all to prevent calls to /null
|
||||||
menuActive: MENU_ACTIVE,
|
menuActive: MENU_ACTIVE,
|
||||||
userInfo: state => state.auth.info,
|
userInfo: state => state.auth.info,
|
||||||
authenticated: state => state.auth.authenticated,
|
authenticated: state => state.auth.authenticated,
|
||||||
|
|
|
@ -38,6 +38,7 @@
|
||||||
"loginWith": "Log in with {provider}",
|
"loginWith": "Log in with {provider}",
|
||||||
"authenticating": "Authenticating…",
|
"authenticating": "Authenticating…",
|
||||||
"openIdStateError": "State does not match, refusing to continue!",
|
"openIdStateError": "State does not match, refusing to continue!",
|
||||||
|
"openIdGeneralError": "An error occured while authenticating against the third party.",
|
||||||
"logout": "Logout"
|
"logout": "Logout"
|
||||||
},
|
},
|
||||||
"settings": {
|
"settings": {
|
||||||
|
|
|
@ -39,8 +39,18 @@ export default {
|
||||||
}
|
}
|
||||||
localStorage.setItem('authenticating', true)
|
localStorage.setItem('authenticating', true)
|
||||||
|
|
||||||
|
if (typeof this.$route.query.error !== 'undefined') {
|
||||||
|
let error = this.$t('user.auth.openIdGeneralError')
|
||||||
|
if (typeof this.$route.query.message !== 'undefined') {
|
||||||
|
error = this.$route.query.message
|
||||||
|
}
|
||||||
|
localStorage.removeItem('authenticating')
|
||||||
|
this.$store.commit(ERROR_MESSAGE, error)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const state = localStorage.getItem('state')
|
const state = localStorage.getItem('state')
|
||||||
if(typeof this.$route.query.state === 'undefined' || this.$route.query.state !== state) {
|
if (typeof this.$route.query.state === 'undefined' || this.$route.query.state !== state) {
|
||||||
localStorage.removeItem('authenticating')
|
localStorage.removeItem('authenticating')
|
||||||
this.$store.commit(ERROR_MESSAGE, this.$t('user.auth.openIdStateError'))
|
this.$store.commit(ERROR_MESSAGE, this.$t('user.auth.openIdStateError'))
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue