From b9637e1bb6d543b7fdb97c783c9d96d8d55049dc Mon Sep 17 00:00:00 2001 From: Dominik Pschenitschni Date: Sun, 10 Apr 2022 18:42:29 +0000 Subject: [PATCH] chore: simple Login view improvements (#1791) Co-authored-by: Dominik Pschenitschni Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/1791 Reviewed-by: konrad Co-authored-by: Dominik Pschenitschni Co-committed-by: Dominik Pschenitschni --- src/views/user/Login.vue | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/views/user/Login.vue b/src/views/user/Login.vue index 4a2ec898..7bf24146 100644 --- a/src/views/user/Login.vue +++ b/src/views/user/Login.vue @@ -88,9 +88,9 @@ v-if="hasOpenIdProviders" class="mt-4"> @@ -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,