Fix redirection after login
Closes #1067 Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
2e1c284565
commit
05648fc1f4
@ -189,6 +189,8 @@ export default class Login extends Vue {
|
|||||||
password: "",
|
password: "",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
redirect: string | undefined = "";
|
||||||
|
|
||||||
errors: string[] = [];
|
errors: string[] = [];
|
||||||
|
|
||||||
rules = {
|
rules = {
|
||||||
@ -204,6 +206,7 @@ export default class Login extends Vue {
|
|||||||
|
|
||||||
const { query } = this.$route;
|
const { query } = this.$route;
|
||||||
this.errorCode = query.code as LoginErrorCode;
|
this.errorCode = query.code as LoginErrorCode;
|
||||||
|
this.redirect = query.redirect as string | undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
async loginAction(e: Event): Promise<Route | void> {
|
async loginAction(e: Event): Promise<Route | void> {
|
||||||
@ -230,8 +233,8 @@ export default class Login extends Vue {
|
|||||||
saveUserData(data.login);
|
saveUserData(data.login);
|
||||||
await this.setupClientUserAndActors(data.login);
|
await this.setupClientUserAndActors(data.login);
|
||||||
|
|
||||||
if (this.$route.query.redirect) {
|
if (this.redirect) {
|
||||||
this.$router.push(this.$route.query.redirect as string);
|
this.$router.push(this.redirect as string);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (window.localStorage) {
|
if (window.localStorage) {
|
||||||
|
Loading…
Reference in New Issue
Block a user