Add showing and modifying user name #306

Merged
konrad merged 10 commits from feature/user-name into master 2020-11-21 21:25:00 +00:00
2 changed files with 9 additions and 2 deletions
Showing only changes of commit ab0c30013b - Show all commits

View File

@ -6,7 +6,7 @@
You successfully confirmed your email! You can log in now.
</div>
<api-config/>
<form @submit.prevent="submit" id="loginform">
<form @submit.prevent="submit" id="loginform" v-if="localAuthEnabled">
<div class="field">
<label class="label" for="username">Username</label>
<div class="control">
@ -136,7 +136,7 @@ export default {
errorMessage: ERROR_MESSAGE,
needsTotpPasscode: state => state.auth.needsTotpPasscode,
authenticated: state => state.auth.authenticated,
localAuthEnabled: state => state.config.auth.enabled,
localAuthEnabled: state => state.config.auth.local.enabled,
openidConnect: state => state.config.auth.openidConnect,
}),
methods: {

View File

@ -38,6 +38,13 @@ export default {
}
localStorage.setItem('authenticating', true)
const state = localStorage.getItem('state')
if(typeof this.$route.query.state === 'undefined' || this.$route.query.state !== state) {
localStorage.removeItem('authenticating')
this.$store.commit(ERROR_MESSAGE, 'State does not match, refusing to continue!')
return
}
this.$store.commit(ERROR_MESSAGE, '')
this.$store.dispatch('auth/openIdAuth', {