[O] Only clear cookies if cookies exists
This commit is contained in:
@@ -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'));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user