You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I struggle to properly implement an url callback for an item. I have the following snipped of code and I expect it to redirect me to a login page and then to the correct url
Pressing the item indeed brings me to the login page with the following URL:
http://localhost:8080/login?callbackUrl=http://localhost:8080/trainer/61b9a434f308ef980ec59205
On this page, completing the login generates a user in the session but doesn't redirect me to the desired page (it redirects me to the same login page instead)
I managed to override the redirect callback as follows
http://localhost:8080/login?callbackUrl=/trainer/61b9a434f308ef980ec59205
And this works but it generates an error in the console about an invalid JWT so I really don't feel like it's the intended behaviour
https://next-auth.js.org/errors#jwt_session_error decryption operation failed {
message: 'decryption operation failed',
stack: 'JWEDecryptionFailed: decryption operation failed\n' +
' at gcmDecrypt (/home/vinter/frontend-service/node_modules/jose/dist/node/cjs/runtime/decrypt.js:67:15)\n' +
' at decrypt (/home/vinter/frontend-service/node_modules/jose/dist/node/cjs/runtime/decrypt.js:92:20)\n' +
' at flattenedDecrypt (/home/vinter/frontend-service/node_modules/jose/dist/node/cjs/jwe/flattened/decrypt.js:119:52)\n' +
' at runMicrotasks (<anonymous>)\n' +
' at processTicksAndRejections (internal/process/task_queues.js:93:5)\n' +
' at async compactDecrypt (/home/vinter/frontend-service/node_modules/jose/dist/node/cjs/jwe/compact/decrypt.js:18:23)\n' +
' at async jwtDecrypt (/home/vinter/frontend-service/node_modules/jose/dist/node/cjs/jwt/decrypt.js:8:23)\n' +
' at async Object.decode (/home/vinter/frontend-service/node_modules/next-auth/jwt/index.js:62:7)\n' +
' at async Object.session (/home/vinter/frontend-service/node_modules/next-auth/core/routes/session.js:41:28)\n' +
' at async NextAuthHandler (/home/vinter/frontend-service/node_modules/next-auth/core/index.js:96:27)',
name: 'JWEDecryptionFailed'
}
How to reproduce ☕️
I tried reproducing it on the next-auth-example project but it seems to be working fine. There's probably something weird going on in my project, thanks.
questionAsk how to do something or how something works
1 participant
Converted from issue
This discussion was converted from issue #3676 on January 20, 2022 00:50.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Question 💬
I struggle to properly implement an url callback for an item. I have the following snipped of code and I expect it to redirect me to a login page and then to the correct url
Pressing the item indeed brings me to the login page with the following URL:
http://localhost:8080/login?callbackUrl=http://localhost:8080/trainer/61b9a434f308ef980ec59205
On this page, completing the login generates a user in the session but doesn't redirect me to the desired page (it redirects me to the same login page instead)
I managed to override the redirect callback as follows
Which gives me the following url when pressed
http://localhost:8080/login?callbackUrl=/trainer/61b9a434f308ef980ec59205
And this works but it generates an error in the console about an invalid JWT so I really don't feel like it's the intended behaviour
How to reproduce ☕️
I tried reproducing it on the next-auth-example project but it seems to be working fine. There's probably something weird going on in my project, thanks.
Contributing 🙌🏽
No, I am afraid I cannot help regarding this
Beta Was this translation helpful? Give feedback.
All reactions