options.token.name not used anymore
Version
Steps to reproduce
Set token.name to false.
Login using any strategy.
Token is still set in localStorage under key 'auth._token.local' or whatever other strategy is used.
What is expected ?
Token should not appear in localStorage.
What is actually happening?
Token is still set in local storage.
Additional comments?
I've just upgraded from 4.0.0-rc.3 to 4.0.1. In older version version I've set token.name to false since I'm using same auth in multiple nuxt projects. Lets say my cookie domain is '.example.com' and i have nuxt projects on 'admin.example.com' (d1) and 'store.example.com' (d2). If a user logs in on d1 cookies and local storage are set, and then if he goes to d2 he will be logged in automatically, which is desired. But if he then logs out either on d1 (or d2) and navigates to d2 (or d1) he will be logged in again since local storage was not cleared, at the same time new cookie will be set which is valid for both domains, and voila user is logged in on both domains again like he never logged out.
It looks to me all values are saved both in local storage and cookies, maybe you could provide an option to disable local storage completely?
It looks like you can no longer customize the name, but you can still disable certain universal storage techniques:
- setCookie checks for falsey
options.cookie, so instead of settingcookie.nameto false, you should setcookieto false - setLocalStorage is similar, so in your case you should set
localStorageto false.
Does that help?
Looks like the docs are out of date, I'll update them when I get a sec
It works, thanks. I somehow missed that while I was going trough source.
Edit: I'll open another issue for server side problem, close this once doc is update.
Hey @Sheby, let me know how the documentation looks when changed in the above PR #135. 😃
@benmccallum seems good. On different issue #133 , could you just add that if token.prefix starts with "_" local store won't work on server side.
Sure thing, let's discuss that over there. The PR can treat both.