Conversation
- Changed storage reliance on pinia: Pinia is no longer required to use the auth module, but can still be used. By default it is disabled and instead nuxt's useState will be used instead. - Moved login watch to plugin: This is still in testing however I found that watching loggedIn works better when it's in a plugin. - Consolidated store/storage options: localStorage, sessionStorage, cookie, and pinia have all been moved under on property called 'stores'. Theves also been shortened in name so localStorage is 'local', cookie is 'cookie', and sessionStorage is 'session'. The strategy cookie, will no longer be present if you're not logged in. The syncUniversal/setUniversal now accept a third object parameter that dictates whether or not you want to exclude a store (the store wont be added in any case if its disabled in your options). In the case for cookies you can either use a boolean or an object which contains the cookie's options.
- The Cookie scheme has been added back under the local scheme. It still retains the same functionality if you're not using the token property. - The Laravel Sanctum provider will use the token method, if you'd like to use the SPA method set token.type to false. - Documentation stackblitz has been update to reflect changes: https://stackblitz.com/edit/github-nufjhw?file=README.md
- When configuring the auth options the strategies would have no type hinting. This update aims to fix this.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes & Additions
Pinia
Pinia is no longer required to use the auth module but can still be used. By default, it is disabled and instead nuxt's useState will be used instead.
Storage
stores. The storage names also been shortened so localStorage islocal, cookie iscookie, and sessionStorage issession.Cookie Scheme
token.typeto false.Typescript
Nuxt i18n
The module now has basic support for
nuxt/i18n. Since this is new, if you encounter any issues please don't hesitate to ask. The i18n will change the locale of the redirects.Documentation
I don't have the resources to set up a documentation page for all of these, but I still do have the Stackblitz setup so you may use that as I will update it when needed.