Session Callback Not Triggering in NextAuth Integration with tRPC #11555
Unanswered
wilsuriel03
asked this question in
Help
Replies: 1 comment
-
@balazsorban44 @ThangHuuVu I am using the jwt session strategy but facing issues with triggering the session callback. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everyone,
I'm currently experiencing an issue with my Next.js application where the session callback in NextAuth is not being triggered as expected when using tRPC. I have a monorepo setup with two apps: an e-commerce app and an admin panel for managing the e-commerce app. The problem seems to be isolated to the admin panel, and the session callback works correctly when logging in with the Google provider but not with credentials.
Project Setup:
Problem Description:
The session callback is not being triggered when logging in with credentials, resulting in undefined session data being passed to tRPC context. However, when logging in with the Google provider, the session callback works correctly, and the session data is properly logged.
Logs:
Credentials Login Attempt:
Google Login Attempt:
Code :
Sign-In Page Using Credentials (with tRPC):
Google Sign-In Page (without tRPC):
NextAuth Configuration:
NextAuth export:
Auth Package Export:
Middleware Configuration:
API Route Handling:
tRPC Context Creation:
tRPC authRouter:
Help Needed:
I'm seeking assistance to understand why the session callback is not being triggered when using credentials and why the session data is not being correctly passed to tRPC context. Any insights or suggestions on what might be going wrong would be greatly appreciated.
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions