Skip to content

v4.0.0-next.19

Pre-release
Pre-release
Compare
Choose a tag to compare
@github-actions github-actions released this 11 Jul 22:19
acc9393

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"]