chore: simple Login view improvements (#1791)

Co-authored-by: Dominik Pschenitschni <mail@celement.de>
Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/1791
Reviewed-by: konrad <k@knt.li>
Co-authored-by: Dominik Pschenitschni <dpschen@noreply.kolaente.de>
Co-committed-by: Dominik Pschenitschni <dpschen@noreply.kolaente.de>
This commit is contained in:
Dominik Pschenitschni 2022-04-10 18:42:29 +00:00 committed by konrad
parent aff83773af
commit b9637e1bb6

View file

@ -88,9 +88,9 @@
v-if="hasOpenIdProviders"
class="mt-4">
<x-button
@click="redirectToProvider(p)"
v-for="(p, k) in openidConnect.providers"
:key="k"
@click="redirectToProvider(p)"
variant="secondary"
class="is-fullwidth mt-2"
>
@ -134,17 +134,16 @@ export default defineComponent({
// FIXME: Why is this here? Can we find a better place for this?
let emailVerifyToken = localStorage.getItem('emailConfirmToken')
if (emailVerifyToken) {
const cancel = this.setLoading()
const stopLoading = this.setLoading()
HTTP.post('user/confirm', {token: emailVerifyToken})
.then(() => {
localStorage.removeItem('emailConfirmToken')
this.confirmedEmailSuccess = true
cancel()
})
.catch(e => {
cancel()
this.errorMessage = e.response.data.message
})
.finally(stopLoading)
}
// Check if the user is already logged in, if so, redirect them to the homepage
@ -166,9 +165,7 @@ export default defineComponent({
},
computed: {
hasOpenIdProviders() {
return this.openidConnect.enabled &&
this.openidConnect.providers &&
this.openidConnect.providers.length > 0
return this.openidConnect.enabled && this.openidConnect.providers?.length > 0
},
...mapState({
registrationEnabled: state => state.config.registrationEnabled,