github nextauthjs/next-auth v4.0.0-next.19

latest releases: @auth/azure-tables-adapter@0.7.0, @auth/d1-adapter@0.8.0, @auth/dgraph-adapter@1.6.0...
pre-release2 years ago

4.0.0-next.19 (2021-07-11)

Features

BREAKING CHANGES

  • logger: The main change is that instead of an unknown number of parameters, the log events have at most two, where the second parameter is usually an object. In the case of the error event, it can also be an Error instance (that is serializable by JSON.stringify). If it is an object, an Error instance will be available on metadata.error, and message will default to metadata.error.message. This is done so that an error event always provides some kind of a stack to see where the error happened
// [...nextauth.js]
import log from "some-logger-service"
...
logger: {
- error(code, ...message) {},
+ error(code, metadata) {},
- warn(code, ...message) {},
+ warn(code) {}
- debug(code, ...message) {}
+ debug(code, metadata) {}
}
  • The state option on OAuth providers is now deprecated. Use checks: ["state"] instead.
    protections is renamed to checks, here is an example:
- protection: ["pkce"]
+ checks: ["pkece"]

Furthermore, string values are not supported anymore. This is to be able to handle fewer cases internally.

- checks: "state"
+ checks: ["state"]

Don't miss a new next-auth release

NewReleases is sending notifications on new releases.