Releases: sidebase/nuxt-auth
0.3.0-alpha.3
To use the new version:
npm i -D @sidebase/[email protected]What's Changed
- feat: add
trustHostoption and fallback tohostif not in production by @JoaoPedroAS51 in #76 - release: 0.3.0-alpha.3 by @BracketJohn in #80
Full Changelog: 0.3.0-alpha.2...0.3.0-alpha.3
0.3.0-alpha.2
To use the new version:
npm i -D @sidebase/[email protected]What's Changed
- fix: don't set
loadingtotrueon usegetSessionby @JoaoPedroAS51 in #75 - Fix nuxt instance unavailable by @BracketJohn in #78
- release: 0.3.0-alpha.2 by @BracketJohn in #79
New Contributors
- @JoaoPedroAS51 made their first contribution in #75
Full Changelog: 0.3.0-alpha.1...0.3.0-alpha.2
0.3.0-alpha.1
To use the new version:
npm i -D @sidebase/[email protected]A big thanks to @JoaoPedroAS51 who gave the inspiration + code examples and reviewed the code for this ❤️
What's Changed
This release is a bigger one and contains some breaking things, which is why we go from 0.2 to 0.3. This release:
- feat: delegates auth- and session-lifecycle management to a plugin
- feat!: makes
useSessionsync based on this change: no moreawaitin your setup code - feat: adds
lastRefreshedAtto the session properties to allow you to act based on this time - feat!: adds a auth middleware, use it:
- globally via the
nuxt.config.ts: https://github.com/sidebase/nuxt-auth#global-middleware - locally via
definePageMeta: https://github.com/sidebase/nuxt-auth#local-middleware
- globally via the
- feat!:
getCsrfTokenreturns the token string directly, instead of an object that contains the token - refactors the internal structure a big
Breaking changes
- feat!: makes
useSessionsync
useSession is now synchronous. The initial session is fetched via a plugin that is loaded on app-startup. In your app replace:
// 1. old way to get data and status without forcing auth
const { data, status } = await useSession({ required: false })
// 2. old way to force auth
await useSession()with:
// 1. new way to get data and status without forcing auth
const { data, status } = useSession()
// 2. new way to force auth: there's 2
// - recommended: use middlewares, read on in breaking change number (2) below or in docs https://github.com/sidebase/nuxt-auth#middleware
// - possible to support old-style manual checks:
const { getSession } = useSession()
await getSession()and you're good to go. Note that useSession will also not directly force a login anymore. This is instead done via the new authentication middleware, see the related change below at number (2).
- feat!: adds a auth middleware
This is a new approach to page protection that works either globally for the whole app or locally for certain pages. Check out the docs on this here: https://github.com/sidebase/nuxt-auth#middleware
If you want to keep using the 0.2.x approach of writing protection middlewares yourself, you can do this as follows:
const { getSession } = useSession()
// This will trigger a redirect if not logged in, just as `await useSession()` used to do. Also supports same additional options like `callbackUrl`
await getSession({ required: true }) - feat!:
getCsrfTokenreturns the token string directly, instead of an object that contains the token
The return of getCsrfToken changed:
// old
console.log(await getCsrfToken())
// outputs: { token: 'asdfjklasdhjklasdhjlasdjlasdjkljklasd' }
// new
console.log(await getCsrfToken())
// outputs: 'asdfjklasdhjklasdhjlasdjlasdjkljklasd'Commits
- Make use session sync, use a plugin based approach for session fetching by @BracketJohn in #69
- release: 0.3.0-alpha.1 by @BracketJohn in #73
Full Changelog: 0.2.1...0.3.0-alpha.1
First Time Contributor
As above, can not be stated enough: A big thanks to @JoaoPedroAS51 who gave the inspiration + code examples and reviewed the code for this ❤️
0.2.1
To use the new version:
npm i -D @sidebase/[email protected]What's Changed
- fix: create runtimeConfig in nuxt options if empty by @AndreyYolkin in #63
- docs: add strapi provider example by @darwebdb in #44
- chore: fix typo by @manniL in #66
- Added documentation and sync workflows by @zoey-kaiser in #60
- Updated docs to match ReadMe by @zoey-kaiser in #67
- fix: actually warn when origin is unset by @manniL in #68
- release: 0.2.1 by @BracketJohn in #71
New Contributors
- @AndreyYolkin made their first contribution in #63
- @darwebdb made their first contribution in #44
- @manniL made their first contribution in #66
- @zoey-kaiser made their first contribution in #60
Full Changelog: 0.2.0...0.2.1
0.2.0
To use the new version:
npm i -D @sidebase/[email protected]What's Changed
- fix(docs): port typo by @BracketJohn in #49
- fix: always set method to
GETfor internal getServerSession requests by @BracketJohn in #54 - fix: always upper-case methods before passing them around or comparing them by @BracketJohn in #56
- feat: upgrade to nuxt stable, upgrade minor deps as well by @BracketJohn in #57
- release: 0.2.0 by @BracketJohn in #58
Full Changelog: 0.1.3...0.2.0
0.1.3
To upgrade:
npm i -D @sidebase/[email protected]What's Changed
- fix: sign in options inherit from Record by @BracketJohn in #46
- docs: expand custom sign in page docs by @BracketJohn in #47
- release: 0.1.3 by @BracketJohn in #48
Full Changelog: 0.1.2...0.1.3
0.1.2
To upgrade:
npm i -D @sidebase/[email protected]What's Changed
- Move
originchecking to runtime by @BracketJohn in #41 - Release 0.1.2 by @BracketJohn in #42
Full Changelog: 0.1.1...0.1.2
0.1.1
To upgrade:
npm i -D @sidebase/[email protected]Noteworthy addition:
// Trigger a sign out and send the user to the sign out page afterwards
await signOut({ calbackUrl: '/signout' })What's Changed
- feat: add callback url on signout + document it by @BracketJohn in #35
- fix: session and data types by @BracketJohn in #36
- release: 0.1.1 by @BracketJohn in #38
Full Changelog: 0.1.0...0.1.1
0.1.0
This is the first non-beta release of nuxt-auth 🎊
To upgrade:
npm i -D @sidebase/nuxt-authWhat's Changed
- feat: make useSession isomorph 🎊 by @BracketJohn in #31
- docs: add security section (#31)
- docs: add custom sign in page section (#31)
- fix(docs): credentials provider example becomes more realistic (#31)
- release: 0.1.0 by @BracketJohn in #33
Available at: https://www.npmjs.com/package/@sidebase/nuxt-auth
Full Changelog: 0.0.1-beta.7...0.1.0
0.0.1-beta.7
What's Changed
- Hotfix use
parseCookiesinstead of undefineduseCookiesand release beta.7 by @BracketJohn in #27
Full Changelog: 0.0.1-beta.6...0.0.1-beta.7