-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Release v4 #3307
Merged
Merged
Release v4 #3307
Conversation
This file contains 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
BREAKING CHANGE: We have supported throwing strings for redirections, while we were showing a waring. From now on, it is not possible. The user MUST return a string, rather than throw it.
BREAKING CHANGE: adding `state: true` is already redundant as `protection: "state` is the default value. `state: false` can be substituted with `protection: "state"`
* feat(build): optionally include TypeORM If the user doesn't use databases, it shouldn't be necessary to iclude it in the bundle. This can more than half the package size! * feat(build): clean up in dependencies Remove unused dependencies, move optional ones to be optional * feat(build): add exports field * fix: use peerDependenciesMeta instead of non-standard peerOptionalDependecns field * fix: ts-standard string quotes * fix: ts-standard string quotes * refactor: use asnyc/await for sendVerificationRequest * chore(deps): upgrade mongodb, remove require_optional Co-authored-by: ndom91 <[email protected]> BREAKING CHANGE: `typeorm`, and `nodemailer` are no longer dependencies added by default. If you need any of them, you will have to install them yourself in your project directory. TypeOrm is the default adapter, so if you only provide an `adapter` configuration or a `database`, you will need `typeorm`. You could also check out `@next-auth/typeorm-adapter`. In case you are using the Email provider, you will have to install `nodemailer` (or you can use the choice of your library in the `sendVerificationRequest` callback to send out the e-mail.)
* chore(deps): add optional-require * refactor: use optional-require
* chore(deps): switch back to (updated) require_optional * fix: use @balazsorban/require-optional
Conflicts: config/babel.config.json package-lock.json package.json src/server/index.js src/server/routes/callback.js src/server/routes/signin.js
* feat(adapter): remove built-in adapters and database BREAKING CHANGE: 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. ```diff // [...nextauth].js + import TypeORMAdapter from "@next-auth/typeorm-legacy-adapter" import NextAuth from "next-auth" ... export default NextAuth({ - database: "yourconnectionstring", + adapter: TypeORMAdapter("yourconnectionstring") }) ``` Co-authored-by: Lluis Agusti <[email protected]> Co-authored-by: Giovanni Carnel <[email protected]>
BREAKING CHANGE: If you currently use `AzureADB2C`, you will need to update it to to `AzureAD` There should be no other changes needed.
**What**: These changes ensure that we work more tightly with React that can also result in unforeseen performance boosts. In case we would decide on expanding to other libraries/frameworks, a new file per framework could be added. **Why**: Some performance issues (#844) could only be fixed by moving more of the client code into the `Provider`. **How**: Refactoring `next-auth/client` Related: #1461, #1084, #1462 BREAKING CHANGE: **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: ```diff - <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: ```jsx 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> ) } ```
* docs: add versioned docs for unreleased canary 4.x * docs(fix): prettier broke custom image component without .mdx extension * docs(feat): automatically fetch latest stable version label * docs: cleanup script * docs: cleanup next version name * docs(chore): cleanup version leftovers * docs: fix .gitignore * docs: v4 default * docs: remove auto version generation * docs: fix missing import * docs: rm node-fetch
commit 6654458 Author: Balázs Orbán <[email protected]> Date: Sat Jun 12 17:11:53 2021 +0200 docs(config): link to next documentation instead of canary commit 67cf2a1 Author: ndom91 <[email protected]> Date: Sat Jun 12 16:42:48 2021 +0200 docs: fix alt client provider example
* English language sentence fix Co-authored-by: Balázs Orbán <[email protected]>
* fix(docs): scope expects space separated string Currently the docs list string[] as possible type for scope. However, It only accepts a string (with space as separator). Co-authored-by: Balázs Orbán <[email protected]>
* chore: remove legacy code * fix(providers): refactor Apple provider * chore(dev): add Apple provider * docs(providers): add `generateClientSecret` to JSDoc * fix(providers): use `jose@4` * fix(providers): use seconds since epoch, correct sign * chore(providers): move secret generator into a script
* Ensure that GitHub provider always gives an email * Update src/providers/github.js Co-authored-by: Balázs Orbán <[email protected]> Co-authored-by: Balázs Orbán <[email protected]>
5 tasks
🎉 Experimental release published on npm! npm i [email protected] yarn add [email protected] |
ndom91
approved these changes
Dec 1, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 🎉
ndom91
approved these changes
Dec 1, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 🎉
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.
No description provided.