Skip to content

Commit 905b874

Browse files
committed
Removed legacy workarounds for database session strategy support
1 parent 5bb4be6 commit 905b874

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

utilities/next-auth.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ import Google from "next-auth/providers/google";
88
import GitHub from "next-auth/providers/github";
99
import { join } from "path";
1010
import NextAuth from "next-auth";
11-
import { encode } from "next-auth/jwt";
12-
import { cookies } from "next/headers";
1311
import { readdir } from "fs/promises";
1412
import Credentials from "next-auth/providers/credentials";
1513
import { existsSync } from "fs";
@@ -21,17 +19,16 @@ import { logger } from "./pino";
2119
import sendVerificationRequest from "./node-mailer";
2220

2321
export const { handlers, auth, signIn, signOut } = NextAuth( () => ( {
24-
jwt: {
25-
encode: async ( params ) => cookies().get( "authjs.session-token" )?.value ?? encode( params )
26-
},
2722
pages: {
2823
error: "/",
2924
signIn: "/authentication",
3025
signOut: "/",
3126
verifyRequest: "/authentication?error=ValidationRequired"
3227
},
3328
adapter: PrismaAdapter( prisma ) as Adapter, // https://github.com/nextauthjs/next-auth/issues/9493#issuecomment-1871601543
34-
strategy: "jwt",
29+
session: {
30+
strategy: "jwt"
31+
},
3532
basePath: `${ process.env.__NEXT_ROUTER_BASEPATH }/api/user/auth`,
3633
trustHost: true,
3734
callbacks: {

0 commit comments

Comments
 (0)