Skip to content

Commit 8352ffd

Browse files
committed
use secure cookie prefix when decrypting jwt
1 parent 4a015b7 commit 8352ffd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/lib/server/getDecryptedJWT.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@ import { getToken, type JWT } from "@auth/core/jwt";
1313
*/
1414
export const getDecryptedJWT = async (req: Request): Promise<JWT | null> => {
1515
console.log("[DEBUG] AUTH_SECRET:", env.AUTH_SECRET);
16-
const token = await getToken({ req, secret: env.AUTH_SECRET });
16+
console.log("[DEBUG] Incoming request:", req);
17+
const token = await getToken({
18+
req,
19+
secret: env.AUTH_SECRET,
20+
secureCookie: env.NODE_ENV === "production",
21+
});
1722
console.log("[DEBUG] Decrypted JWT:", token);
1823

1924
return token;

0 commit comments

Comments
 (0)