From 05648fc1f43dbf280ad8ab35d631ed2559e44eaa Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Mon, 4 Apr 2022 15:57:44 +0200 Subject: [PATCH] Fix redirection after login Closes #1067 Signed-off-by: Thomas Citharel --- js/src/views/User/Login.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/js/src/views/User/Login.vue b/js/src/views/User/Login.vue index 6a5322a2..56bff707 100644 --- a/js/src/views/User/Login.vue +++ b/js/src/views/User/Login.vue @@ -189,6 +189,8 @@ export default class Login extends Vue { password: "", }; + redirect: string | undefined = ""; + errors: string[] = []; rules = { @@ -204,6 +206,7 @@ export default class Login extends Vue { const { query } = this.$route; this.errorCode = query.code as LoginErrorCode; + this.redirect = query.redirect as string | undefined; } async loginAction(e: Event): Promise { @@ -230,8 +233,8 @@ export default class Login extends Vue { saveUserData(data.login); await this.setupClientUserAndActors(data.login); - if (this.$route.query.redirect) { - this.$router.push(this.$route.query.redirect as string); + if (this.redirect) { + this.$router.push(this.redirect as string); return; } if (window.localStorage) {