Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

next-auth login() redirection doesn't work #52

Open
adamsh25 opened this issue Nov 14, 2022 · 5 comments
Open

next-auth login() redirection doesn't work #52

adamsh25 opened this issue Nov 14, 2022 · 5 comments
Labels
question Further information is requested

Comments

@adamsh25
Copy link

Use case:
I used the repo below and added next-auth using Cognito provider:
https://github.com/plevavas/monorepo
https://next-auth.js.org/getting-started/example
https://next-auth.js.org/providers/cognito

The redirection to Cognito login does work locally when debugging in vs code

Issue:
The redirection to Cognito login does NOT work when deployed with tosladg/nextjs-lambda@v3.20.3

@sladg
Copy link
Owner

sladg commented Nov 14, 2022

Hey @adamsh25 !
Any chance you might have a logs on your hand? Also, if you say that redirection does not work - do you get some Internal Error? Does not not function at all? Do you get stuck on API route?

@adamsh25
Copy link
Author

adamsh25 commented Nov 14, 2022

Hey @sladg I will need to redeploy this test, I will be able to do so over the weekend.
Thank you!

@sladg
Copy link
Owner

sladg commented Nov 15, 2022

I did replicate the behaviour, tested on Cognito and latest Next-auth. It indeed does not redirect properly.
From what I was able to gather around Github, it seems like cookies/headers are not passed properly through Cloudfront, I tried out tweaking Origin Request and Cache policies, but no luck. I wasn't able to find what headers/cookies are used/necessary, it will probably require digging into source code of the next-auth.

Let me know if you find some more info!

@khuezy
Copy link

khuezy commented Nov 23, 2022

Might be related to: nextauthjs/next-auth#5561

@sladg
Copy link
Owner

sladg commented Jan 2, 2023

@adamsh25 was there any luck resolving this with newest version of Next-auth?

@sladg sladg added the question Further information is requested label Feb 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants