Next Auth failing to set next-auth.session-token cookie in headless playwright #12022
Unanswered
JohnAllenTech
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey all!
Essentially I am working on a standard next auth application. You can see it here https://github.com/codu-code/codu
I am running playwright and performing a Github login which logs a user into the application.
E2E Steps to get an authenticated browser state
When I run this code in ui mode of playwright it completes successfully
When I run this code in headless mode it fails due to next-auth.session-token never being set.
Goes to github.com and logins in using an email and password
Goes to my locally running application and starts the Github SSO flow
User is logged into the application but next-auth.session-token is never set. Without that cookie I cant reuse the authenticated browser session.
Anyone got any ideas? It seems like a playwright issue to be fair but I want to understand does next auth not like headless mode?
I see the following cookies in headless mode
where as in ui mode I get the same with the addition of
Actual authentication code I am referring to
Beta Was this translation helpful? Give feedback.
All reactions