[GH-ISSUE #52] JWT Validation Error on Start #22

Closed
opened 2026-10-15 13:01:39 +00:00 by bsakaguchi · 2 comments
Owner

Originally created by @salty2011 on GitHub (Jul 16, 2025).
Original GitHub issue: https://github.com/games-on-whales/wolfmanager/issues/52

When launching WolfManager container and you have a stale cookie from a previous session the console will display numerous errors

wolf-admin-1  | [next-auth][error][JWT_SESSION_ERROR] 
wolf-admin-1  | https://next-auth.js.org/errors#jwt_session_error JWT invalid {
wolf-admin-1  |   message: 'JWT invalid',
wolf-admin-1  |   stack: 'Error: JWT invalid\n' +
wolf-admin-1  |     '    at Object.i (/app/.next/server/chunks/3572.js:25:6932)\n' +
wolf-admin-1  |     '    at async f (/app/.next/server/chunks/3572.js:1:437879)\n' +
wolf-admin-1  |     '    at async o (/app/.next/server/chunks/3572.js:25:20859)\n' +
wolf-admin-1  |     '    at async p (/app/.next/server/chunks/7766.js:1:734)\n' +
wolf-admin-1  |     '    at async /app/node_modules/.pnpm/next@14.2.25_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:16:418\n' +
wolf-admin-1  |     '    at async rE (/app/node_modules/.pnpm/next@14.2.25_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:15:8148)\n' +
wolf-admin-1  |     '    at async r7 (/app/node_modules/.pnpm/next@14.2.25_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:18:1144)\n' +
wolf-admin-1  |     '    at async doRender (/app/node_modules/.pnpm/next@14.2.25_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:1427:30)\n' +
wolf-admin-1  |     '    at async cacheEntry.responseCache.get.routeKind (/app/node_modules/.pnpm/next@14.2.25_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:1588:28)\n' +
wolf-admin-1  |     '    at async NextNodeServer.renderToResponseWithComponentsImpl (/app/node_modules/.pnpm/next@14.2.25_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:1496:28)',
wolf-admin-1  |   name: 'Error'
wolf-admin-1  | }
Originally created by @salty2011 on GitHub (Jul 16, 2025). Original GitHub issue: https://github.com/games-on-whales/wolfmanager/issues/52 When launching WolfManager container and you have a stale cookie from a previous session the console will display numerous errors ``` wolf-admin-1 | [next-auth][error][JWT_SESSION_ERROR] wolf-admin-1 | https://next-auth.js.org/errors#jwt_session_error JWT invalid { wolf-admin-1 | message: 'JWT invalid', wolf-admin-1 | stack: 'Error: JWT invalid\n' + wolf-admin-1 | ' at Object.i (/app/.next/server/chunks/3572.js:25:6932)\n' + wolf-admin-1 | ' at async f (/app/.next/server/chunks/3572.js:1:437879)\n' + wolf-admin-1 | ' at async o (/app/.next/server/chunks/3572.js:25:20859)\n' + wolf-admin-1 | ' at async p (/app/.next/server/chunks/7766.js:1:734)\n' + wolf-admin-1 | ' at async /app/node_modules/.pnpm/next@14.2.25_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:16:418\n' + wolf-admin-1 | ' at async rE (/app/node_modules/.pnpm/next@14.2.25_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:15:8148)\n' + wolf-admin-1 | ' at async r7 (/app/node_modules/.pnpm/next@14.2.25_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:18:1144)\n' + wolf-admin-1 | ' at async doRender (/app/node_modules/.pnpm/next@14.2.25_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:1427:30)\n' + wolf-admin-1 | ' at async cacheEntry.responseCache.get.routeKind (/app/node_modules/.pnpm/next@14.2.25_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:1588:28)\n' + wolf-admin-1 | ' at async NextNodeServer.renderToResponseWithComponentsImpl (/app/node_modules/.pnpm/next@14.2.25_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:1496:28)', wolf-admin-1 | name: 'Error' wolf-admin-1 | } ```
bsakaguchi 2026-10-15 13:01:39 +00:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@salty2011 commented on GitHub (Jul 16, 2025):

Issues doesnt seem to be causing any real issues and it only occurs from an unauthenticated session when you have a stale cookie (ie only really happens from rapid relaunching of the container)

<!-- gh-comment-id:3078695555 --> @salty2011 commented on GitHub (Jul 16, 2025): Issues doesnt seem to be causing any real issues and it only occurs from an unauthenticated session when you have a stale cookie (ie only really happens from rapid relaunching of the container)
Author
Owner

@salty2011 commented on GitHub (Jul 21, 2025):

Issue Resolved ✅

This issue has been resolved in PR #55 which has been merged into release/202507.001.

Changes Made:

  • Enhanced JWT validation error handling in authentication flow
  • Improved error logging and handling for invalid JWT tokens from stale cookies
  • Added better error handling in the authentication middleware
  • Fixed session validation to gracefully handle invalid or expired tokens

Files Modified:

  • src/lib/auth.ts
  • src/lib/actions/logging.ts
  • src/instrumentation.ts

The JWT validation errors should no longer appear in the console when launching the WolfManager container with stale cookies. The authentication system now properly handles invalid tokens and provides better error management.

<!-- gh-comment-id:3094944103 --> @salty2011 commented on GitHub (Jul 21, 2025): ## Issue Resolved ✅ This issue has been resolved in PR #55 which has been merged into `release/202507.001`. ### Changes Made: - Enhanced JWT validation error handling in authentication flow - Improved error logging and handling for invalid JWT tokens from stale cookies - Added better error handling in the authentication middleware - Fixed session validation to gracefully handle invalid or expired tokens ### Files Modified: - `src/lib/auth.ts` - `src/lib/actions/logging.ts` - `src/instrumentation.ts` The JWT validation errors should no longer appear in the console when launching the WolfManager container with stale cookies. The authentication system now properly handles invalid tokens and provides better error management.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
games-on-whales/wolfmanager#22
No description provided.