Upgrade to 1.0.0
This release contains breaking changes for
signIn
andsignUp
functions
🎉 We're excited to share that @sidebase/nuxt-auth
is moving towards its 1.0 release! Read the full roadmap here.
Installation
npm i -D @sidebase/nuxt-auth@^1.0.0
pnpm i -D @sidebase/nuxt-auth@^1.0.0
yarn add --dev @sidebase/nuxt-auth@^1.0.0
⚠️ Breaking changes
signUp
function in local
provider
There's a breaking change in local
provider signUp
function which now only accepts 2 parameters. This is due to signUp
having an extra parameter from its initial implementation.
If you used signUp
with three parameters, merge the third parameter into the second:
await signUp(credentials, { external: true }, { preventLoginFlow: true })
await signUp(credentials, { external: true, preventLoginFlow: true })
await signUp(credentials, undefined, { preventLoginFlow: true })
await signUp(credentials, { preventLoginFlow: true })
signIn
function in authjs
provider
This function now always returns an object SignInResult
:
interface SignInResult {
error: string | null
status: number
ok: boolean
url: any
}
This was done to remove the previously missing | void
from the signature, improving type-safety and usability. If you checked for void
being returned, adjust your usage accordingly:
const signInResponse = await signIn(/* ... */)
const isResponseDefined = signInResponse
const isResponseDefined = signInResponse.error === null
if (isResponseDefined) {
// ...
}
Changelog
- feat: return signin response if no redirection by @despatates in https://github.com/sidebase/nuxt-auth/pull/977
- Enh(#843): Allow signup flow return data when preventLoginFlow is true by @iamKiNG-Fr in https://github.com/sidebase/nuxt-auth/pull/903
- chore: display register error message by @DevDengChao in https://github.com/sidebase/nuxt-auth/pull/1015
- bump dependencies by @phoenix-ru in https://github.com/sidebase/nuxt-auth/pull/1016
- chore: refactor useAuth composables to encapsulate context by @phoenix-ru in https://github.com/sidebase/nuxt-auth/pull/1024
Full Changelog: https://github.com/sidebase/nuxt-auth/compare/0.10.1...v1.0.0