Version
v4.0.1
Steps to reproduce
Use $auth.logout() or $auth.setToken() on server side code.
What is expected ?
User should be logged out and new token set, or set to null.
What is actually happening?
Nothing happens.
Additional comments?
$auth.setToken(...) issue can be resolved by changing token.prefix option from default "token" to "token", or anything else that doesn't start with "".
I used $auth.setToken(...) inside axios interceptor and if the interceptor is triggered on server side request it does nothing.
I haven't found any workaround for $auth.logout() problem yet.
The real problem is that cookies aren't set on server side, setCookie() method in storage.js line 158.
Result is that when auth module mounts on client side it uses syncUniversal() and old value from cookie gets set bot in localStorage and Vue store.
This bug report is available on Nuxt.js community (#c99)
Version
v4.0.1
Steps to reproduce
Use $auth.logout() or $auth.setToken() on server side code.
What is expected ?
User should be logged out and new token set, or set to null.
What is actually happening?
Nothing happens.
Additional comments?
$auth.setToken(...) issue can be resolved by changing token.prefix option from default "token" to "token", or anything else that doesn't start with "".
I used $auth.setToken(...) inside axios interceptor and if the interceptor is triggered on server side request it does nothing.
I haven't found any workaround for $auth.logout() problem yet.
The real problem is that cookies aren't set on server side, setCookie() method in storage.js line 158.
Result is that when auth module mounts on client side it uses syncUniversal() and old value from cookie gets set bot in localStorage and Vue store.