4.0.0-next.19 (2021-07-11)
Features
- logger: simplify
logger
API (#2344) (acc9393), closes #2342 #1602 - rename
protection
tochecks
(#2255) (6911dd9)
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 anError
instance (that is serializable byJSON.stringify
). If it is an object, anError
instance will be available onmetadata.error
, andmessage
will default tometadata.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. Usechecks: ["state"]
instead.
protections
is renamed tochecks
, 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"]