From 15149d1d07908bef0e2a0cb86cdb7fe8ede1fcc9 Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Mon, 25 May 2020 21:28:41 -0400 Subject: [PATCH] [O] Fix field name mismatch --- src/components/login/login.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/login/login.ts b/src/components/login/login.ts index 596a0b9..13a05eb 100644 --- a/src/components/login/login.ts +++ b/src/components/login/login.ts @@ -74,7 +74,6 @@ export default class Login extends Vue this.login('/login', {username: this.username, password: this.password}) } - /** * Actually post the request and process the response */ @@ -86,13 +85,12 @@ export default class Login extends Vue // Check success if (response.success) { - // Save token to cookies - this.$cookies.set('va.token', response.data.user.token, '27d'); + this.$cookies.set('va.token', response.data.token, '27d'); this.$cookies.set('va.version', Constants.VERSION, '27d'); // Call a custom event with the token - this.$emit('login:user', new LoginUser(response.data.user)); + this.$emit('login:user', new LoginUser(response.data)); } else { @@ -103,6 +101,7 @@ export default class Login extends Vue } // Show error message & allow user to retry + // TODO: Automatic report error this.error = response.data; this.disableInput = this.loading = false; }