Add logger.error callback and error page redirect to NextAuth config
This commit is contained in:
1 parent
17847545dd
commit
46e9f61b35
1 file changed
+6
-1
+6
-1
@@ -57,7 +57,12 @@ export const { handlers, signOut, auth } = NextAuth({
|
||||
trustHost: env.NODE_ENV !== "production",
|
||||
secret: env.AUTH_SECRET,
|
||||
session: { strategy: "jwt", maxAge: 24 * 60 * 60 },
|
||||
pages: { signIn: "/login" },
|
||||
pages: { signIn: "/login", error: "/login" },
|
||||
logger: {
|
||||
error(error) {
|
||||
logger.error("NextAuth error", { error: error.message, stack: error.stack });
|
||||
},
|
||||
},
|
||||
providers: [
|
||||
Credentials({
|
||||
credentials: {
|
||||
|
||||
Reference in new issue
Block a user