[O] Only clear cookies if cookies exists

This commit is contained in:
Hykilpikonna
2019-10-23 20:20:41 -04:00
parent bcee069b32
commit a4b7e0fd46
+3 -3
View File
@@ -23,6 +23,9 @@ export default class Login extends Vue
* This is called when the instance is created. * This is called when the instance is created.
*/ */
public created() public created()
{
// Check login cookies
if (this.$cookies.isKey('va.token'))
{ {
// Check cookies version // Check cookies version
if (this.needToUpdateCookies()) if (this.needToUpdateCookies())
@@ -33,9 +36,6 @@ export default class Login extends Vue
this.$cookies.keys().forEach(key => this.$cookies.remove(key)); this.$cookies.keys().forEach(key => this.$cookies.remove(key));
} }
// Check login cookies
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', this.$cookies.get('va.token'));
} }