[+] Return username with token

This commit is contained in:
Hykilpikonna
2019-10-12 20:09:22 -04:00
parent 5441592d68
commit e28f68aae3
+2 -2
View File
@@ -29,7 +29,7 @@ export default class Login extends Vue
if (this.$cookies.isKey('va.token')) if (this.$cookies.isKey('va.token'))
{ {
// Already contains valid token / TODO: Validate // Already contains valid token / TODO: Validate
this.$emit('login:token', this.$cookies.get('va.token')); this.$emit('login:token', {token: this.$cookies.get('va.token'), user: this.$cookies.get('va.user')});
} }
} }
@@ -55,7 +55,7 @@ export default class Login extends Vue
this.$cookies.set('va.user', this.username); this.$cookies.set('va.user', this.username);
// Call custom event with token // Call custom event with token
this.$emit('login:token', response.data); this.$emit('login:token', {token: response.data, user: this.username});
} }
else else
{ {