next-auth

Authentication for the Web.

ISC License

Downloads
1M
Stars
22K
Committers
786

Bot releases are visible (Hide)

next-auth - v3.27.2

Published by github-actions[bot] over 3 years ago

3.27.2 (2021-07-05)

Bug Fixes

  • ts: improve authorize typing on Credentials provider (#2227) (f5b3c29)
next-auth - v4.0.0-next.18

Published by github-actions[bot] over 3 years ago

4.0.0-next.18 (2021-07-05)

Features

  • react: make session requireable in useSession (#2236) (a2e5afa)

BREAKING CHANGES

  • react: The useSession hook now returns an object. Here is how to accommodate for this change:
- const [ session, loading ] = useSession()
+ const { data: session, status } = useSession()
+ const loading = status === "loading"

With the new status option, you can test states much more clearly.

next-auth - v3.27.1

Published by github-actions[bot] over 3 years ago

3.27.1 (2021-06-27)

Bug Fixes

  • ts: extend server type in Email provider from nodemailer (#2259) (ad6c13c)
next-auth - v4.0.0-next.17

Published by github-actions[bot] over 3 years ago

4.0.0-next.17 (2021-06-26)

Features

BREAKING CHANGES

  • core: The callbacks method signatures are changing the following way:
- signIn(user, account, profileOrEmailOrCredentials)
+ signIn({ user, account, profile, email, credentials })
- redirect(url, baseUrl)
+ redirect({ url, baseUrl })
- session(session, tokenOrUser)
+ session({ session, token, user })
- jwt(token, user, account, OAuthProfile, isNewUser)
+ jwt({ token, user, account, profile, isNewUser })

NOTE: You only need to define the params that you actually need (no more need for _ params.)

This way, if you only need token and account in the jwt callback, you can write:

jwt({ token, account }) {
  if(account) {
    token.accessToken = account.access_token
  }
  return token
}
next-auth - v4.0.0-next.16

Published by github-actions[bot] over 3 years ago

4.0.0-next.16 (2021-06-26)

Features

BREAKING CHANGES

  • The lowest supported Node version isΒ 12. (We still support IE11 in browsers, until that is not dropped by Next.js itself)
next-auth - v3.27.0

Published by github-actions[bot] over 3 years ago

3.27.0 (2021-06-15)

Features

next-auth - v4.0.0-next.15

Published by github-actions[bot] over 3 years ago

4.0.0-next.15 (2021-06-15)

Bug Fixes

  • react: publish react scripts with npm build (#2192) (d10bd9b)
next-auth - v4.0.0-next.14

Published by github-actions[bot] over 3 years ago

4.0.0-next.14 (2021-06-14)

Bug Fixes

  • react: initialize session without loading state (#2180) (86ff89e)
next-auth - v4.0.0-next.13

Published by github-actions[bot] over 3 years ago

4.0.0-next.13 (2021-06-11)

Bug Fixes

  • react: don't use localStorage on server side (#2166) (abaa5ae)
next-auth - v4.0.0-next.12

Published by github-actions[bot] over 3 years ago

4.0.0-next.12 (2021-06-11)

Features

BREAKING CHANGES

1. next-auth/client is renamed to next-auth/react.

2. In the past, we exposed most of the functions with different names for convenience. To simplify our source code, the new React specific client code exports only the following functions, listed with the necessary changes:

  • setOptions: Not exposed anymore, use SessionProvider props
  • options: Not exposed anymore, use SessionProvider props
  • session: Rename to getSession
  • providers: Rename to getProviders
  • csrfToken: Rename to getCsrfToken
  • signin: Rename to signIn
  • signout: Rename to signOut
  • Provider: Rename to SessionProvider

3. Provider changes.

  • Provider is renamed to SessionProvider
  • The options prop is now flattened as the props of SessionProvider.
  • clientMaxAge has been renamed to staleTime.
  • keepAlive has been renamed to refetchInterval.
    An example of the changes:
- <Provider options={{clientMaxAge: 0, keepAlive: 0}}>{children}</Provider>
+ <SessionProvider staleTime={0} refetchInterval={0}>{children}</SessionProvider> 

4. It is now required to wrap the part of your application that uses useSession into a SessionProvider.

Usually, the best place for this is in your pages/_app.jsx file:

import { SessionProvider } from "next-auth/react"

export default function App({
  Component,
  pageProps: { session, ...pageProps }
}) {
  return (
    // `session` comes from `getServerSideProps` or `getInitialProps`.
    // Avoids flickering/session loading on first load.
    <SessionProvider session={session}>
      <Component {...pageProps} />
    </SessionProvider>
  )
}
next-auth - v4.0.0-next.11

Published by github-actions[bot] over 3 years ago

4.0.0-next.11 (2021-06-10)

Bug Fixes

  • ts: add AzureAD to OAuthProviderType (ed34534)

Features

  • provider: refactor Azure AD, B2C providers (#1591) (5ac1db7)

BREAKING CHANGES

  • provider: If you currently use AzureADB2C, you will need to update it to to AzureAD There should be no other changes needed.
next-auth - v4.0.0-next.10

Published by github-actions[bot] over 3 years ago

4.0.0-next.10 (2021-06-10)

Bug Fixes

Features

next-auth - v3.26.1

Published by github-actions[bot] over 3 years ago

3.26.1 (2021-06-09)

Bug Fixes

next-auth - v3.26.0

Published by github-actions[bot] over 3 years ago

3.26.0 (2021-06-09)

Features

next-auth - v4.0.0-next.9

Published by github-actions[bot] over 3 years ago

4.0.0-next.9 (2021-06-09)

Bug Fixes

  • provider: convert github profile id from int to string (#2108) (ea9b6e3)
next-auth - v4.0.0-next.8

Published by github-actions[bot] over 3 years ago

4.0.0-next.8 (2021-06-09)

Features

BREAKING CHANGES

  • adapter: From now on, you will have to import your own adapter

Check out https://github.com/nextauthjs/adapters

The migration is super easy and has HUGE advantages for those not using TypeORM.

// [...nextauth].js
+ import TypeORMAdapter from "@next-auth/typeorm-legacy-adapter"
import NextAuth from "next-auth"

...
export default NextAuth({
-  database: "yourconnectionstring",
+ adapter: TypeORMAdapter("yourconnectionstring")
})
next-auth - v4.0.0-next.7

Published by github-actions[bot] over 3 years ago

4.0.0-next.7 (2021-06-09)

Bug Fixes

Features

next-auth - v3.25.0

Published by github-actions[bot] over 3 years ago

3.25.0 (2021-06-02)

Features

next-auth - v3.24.1

Published by github-actions[bot] over 3 years ago

3.24.1 (2021-06-01)

Bug Fixes

  • client: unit tests setup and providers error handling (#1992) (e8a9e8a)
next-auth - v3.24.0

Published by github-actions[bot] over 3 years ago

3.24.0 (2021-05-28)

Features

Package Rankings
Top 0.76% on Npmjs.org
Related Projects