Skip to content

Releases: sidebase/nuxt-auth

0.4.3

06 Mar 16:25
aaaa6c7
Compare
Choose a tag to compare

🔐 nuxt-auth is an authentication package for Nuxt 3. It provides oauth sign-in, credential sign-in and magic-email sign-in flows. Read more: https://sidebase.io/nuxt-auth/getting-started

This is patch release 0.4.3. It does not contain breaking changes. To use the new version follow the installation instructions:

# install the new release of `nuxt-auth`
npm i -D @sidebase/[email protected]

# install `next-auth` as a peer-dependency if you haven't already done so
npm i [email protected]

What's Changed

🚀 Enhancements

🩹 Fixes & Chores

📝 Documentation

All Commits

New Contributors

Full Changelog: 0.4.2...0.4.3

0.4.2

20 Feb 12:16
bd0438d
Compare
Choose a tag to compare

🔐 nuxt-auth is an authentication package for Nuxt 3. It provides oauth sign-in, credential sign-in and magic-email sign-in flows. Read more: https://sidebase.io/nuxt-auth/getting-started

This is patch release 0.4.2. It does not contain breaking changes. To use the new version follow the installation instructions:

# install the new release of `nuxt-auth`
npm i -D @sidebase/[email protected]

# install `next-auth` as a peer-dependency if you haven't already done so
npm i [email protected]

What's Changed

🩹 Fixes & Chores

📝 Documentation

  • Documentation update: Update 4.custom-session-data.md by @jorgv in #206

New Contributors

Full Changelog: 0.4.1...0.4.2

0.4.1

09 Feb 09:44
c231ae8
Compare
Choose a tag to compare

🔐 nuxt-auth is an authentication package for Nuxt 3. It provides oauth sign-in, credential sign-in and magic-email sign-in flows. Read more: https://sidebase.io/nuxt-auth/getting-started

This is patch release 0.4.1. It does not contain breaking changes. To use the new version follow the installation instructions:

# install the new release of `nuxt-auth`
npm i -D @sidebase/[email protected]

# install `next-auth` as a peer-dependency if you haven't already done so
npm i [email protected]

Checkout the 0.4.0 release notes for the recent, big changes released yesterday.

What's Changed

🩹 Fixes & Chores

📝 Documentation

  • docs: better instructions for peer dep for non-npm package managers by @BracketJohn in #221

All Commits

Full Changelog: 0.4.0...0.4.1

0.4.0

08 Feb 11:33
6f3bb50
Compare
Choose a tag to compare

nuxt-auth is an authentication package for Nuxt 3. It provides oauth sign-in, credential sign-in and magic-email sign-in flows. Read more: https://sidebase.io/nuxt-auth/getting-started

This is a minor release 0.4.0 because it:

  • makes next-auth a peer dependency
  • bumps nuxt to 3.1
  • starts the switch from NextAuthHandler AuthHandler

In addition, this release includes a bunch of features & fixes 🚀

🚨 Breaking Changes

next-auth is a peer-dependency now, so with package managers other than npm you need to manually install it. So, to use the new version:

# install the new release of `nuxt-auth`
npm i -D @sidebase/[email protected]

# install `next-auth` as a peer-dependency
npm i [email protected]

See the full docs here: https://sidebase.io/nuxt-auth/getting-started

What's Changed

🚀 Enhancements

🩹 Fixes & Chores

📝 Documentation

All Commits

New Contributors

Full Changelog: 0.3.4...0.4.0

0.3.4

16 Jan 08:26
1d30d6e
Compare
Choose a tag to compare

What's Changed

nuxt-auth is an authentication package for Nuxt 3. It provides oauth sign-in, credential sign-in and magic-email sign-in flows. Read more: https://sidebase.io/nuxt-auth/getting-started.

This is release 0.3.4: There are no breaking changes in this release.

To use the new version:

npm i -D @sidebase/[email protected]

What's changed

🩹 Fixes & Chores

  • basePath now correctly works for server- and non-server-routes #156
  • release: 0.3.4 by @BracketJohn in #161

All Commits

New Contributors

Full Changelog: 0.3.3...0.3.4

0.3.3

05 Jan 11:49
86c5677
Compare
Choose a tag to compare

nuxt-auth is an authentication package for Nuxt 3. It provides oauth sign-in, credential sign-in and magic-email sign-in flows. Read more: https://sidebase.io/nuxt-auth/getting-started.

This is release 0.3.3:

  • there are no breaking changes in this release,
  • there is one fixed CVE in this release

To use the new version:

npm i -D @sidebase/[email protected]

What's changed

There's a number of new features, fixes and docs-updates as well as one security-update.

🚀 Enhancements

🩹 Fixes & Chores

  • origin is correctly inferred and warning for it missing is correctly displayed #136
  • resolve "nuxt instance undefined" by not using an async composables in auth middleware by @BracketJohn in #136
  • resolve ERR_HTTP_HEADERS_SENT by @BracketJohn in #136
  • attempt lazy auth-handler setup if getServerSession is called befor any auth endpoint @BracketJohn in #125
  • chore: bump eslint and ufo by @BracketJohn in #126
  • fix(middleware): redirect to signIn without using location.replace by @JoaoPedroAS51 in #127
  • chore: update deps nuxt/kit and defu by @BracketJohn in #138
  • provide type for disabling global auth middleware by @BracketJohn in #139
  • chore(deps-dev): bump eslint from 8.30.0 to 8.31.0 by @dependabot in #146
  • Release 0.3.3 by @BracketJohn in #147

🔒 Security

  • resolve CVE-2022-46175 by @BracketJohn in #142
    • parse5 problem of the sub-dep @nuxt/kit
    • no impact on module-users: was only used in an internal build-step, not during production

All Commits

New Contributors

Full Changelog: 0.3.2...0.3.3

0.3.2

23 Dec 16:55
5fc1cfd
Compare
Choose a tag to compare

To use:

npm i -D @sidebase/[email protected]

This is a small follow-up release to 0.3.2 that attempts to fix a longer standing content-flash issue by faking a navigateTo. The full analysis for this problem can be seen in #100.

What's Changed

  • fix: avoid content-flash of protected pages by faking a navigateTo (0568254)
  • docs: improve getServerSession docs by showing how to pass along cookies during universal rendering by @BracketJohn in #124
  • docs: point to sidebase as easy way to start (6980e15)

Full Changelog: 0.3.1...0.3.2

0.3.1

23 Dec 13:04
Compare
Choose a tag to compare

To use:

npm i -D @sidebase/[email protected]

Main impact of this release is:

  1. Better Session typing: With this release Session typing is now correctly inferred thanks to @JoaoPedroAS51 in #115. This means that custom typing of the session will now work:

    import NextAuth, { DefaultSession } from "next-auth";
    
    declare module "next-auth" {
      interface Session {
        user: {
          /** The user's postal address. */
          address: string
        } & DefaultSession["user"]
      }
    }

    Then in code .address becomes available:
    image

  2. Fix redirect: false being ignored for signIn and signOut: There was a bug that effectively lead to redirect: false being ignored on signIn and signOut. This releases fixes this which in turn allows you to for example perform a custom signIn flow or handle sign in errors yourself. See the new documentation on this:
    image

Commits

  • fix: catch errors and retrieve their data on signIn, signOut by @BracketJohn in #122
  • fix: use type Session from next-auth by @JoaoPedroAS51 in #115
  • feat(playground): add example custom sign in page by @BracketJohn in #96
  • feat(docs): cleanup readme, dont repeat same claim multiple times by @BracketJohn in #98
  • fix(docs): finish intro sentence by @BracketJohn in #101
  • fix(docs): Removed index page of docs from mobile sidebar by @zoey-kaiser in #105
  • feat(docs): improve .default ts ignore by replacing it with ts expect error by @BracketJohn in #114
  • feat(docs): state more clearly that this lib is for non-static libraries, state more clearly that next auth ressources can be used by @BracketJohn in #121

Full Changelog: 0.3.0...0.3.1

0.3.0

08 Dec 15:42
75974b7
Compare
Choose a tag to compare

To use the new version:

npm i -D @sidebase/[email protected]

See the docs here: https://sidebase.io/nuxt-auth/getting-started

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. If you were already using 0.3.0-alpha.X you're fine and none of the below breaking changes apply to you.

In comparison to 0.2.x this release:

  • feat: delegates auth- and session-lifecycle management to a plugin
  • feat!: makes useSession sync based on this change: no more await in your setup code
  • feat: adds lastRefreshedAt to the session properties to allow you to act based on this time
  • feat!: adds a auth middleware, use it:
  • feat!: getCsrfToken returns the token string directly, instead of an object that contains the token
  • refactors the internal structure a bit: add utils/ folders, clean up some typing and comments

Breaking changes

  1. feat!: makes useSession sync

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).

  1. 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 })  
  1. feat!: getCsrfToken returns 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'

Commites

New Contributors

Full Changelog: 0.2.1...0.3.0

0.3.0-alpha.3

05 Dec 17:00
ee86d5d
Compare
Choose a tag to compare
0.3.0-alpha.3 Pre-release
Pre-release

To use the new version:

npm i -D @sidebase/[email protected]

What's Changed

Full Changelog: 0.3.0-alpha.2...0.3.0-alpha.3