Skip to content

Commit

Permalink
NoJira: Update to Next12+ getcookie return value (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
sherakama authored Jan 12, 2023
1 parent 18f37b0 commit 3156c92
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/jwt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ export const validateSessionCookie = async <T extends { cookies?: Record<string,
let token;

try {
// Cookie accessor pattern for Next 12 middleware.
token = req.cookies.get(name);
// Cookie accessor pattern for Next 12+ middleware.
const cookieInfo = req.cookies.get(name);
token = cookieInfo?.value;
}
// Cookie access for Next 11 and other frameworks that use Express cookie-parser.
catch(err) {
Expand Down

0 comments on commit 3156c92

Please sign in to comment.