Generating next-auth.session-token from access token for cypress e2e test automation
Unanswered
LaPerm posted this in #help-forum
LaPermOP
Hi everyone,
I'm setting up Cypress testing for my Next.js project and have hit a roadblock regarding the next-auth.session-token cookie. I need to automate the login process, which requires setting this cookie.
I've reviewed the documentation and understand that a JWT is created using the access token and other values, then serialized using the cookie.js module. However, I can't pinpoint the exact procedure to generate a session token from the access token.
Here's what I have:
- Access to the access token
- Access to NEXTAUTH_SECRET
Has anyone successfully created a session token from an access token for NextAuth? Any guidance or similar experiences would be greatly appreciated. Thanks!
I'm setting up Cypress testing for my Next.js project and have hit a roadblock regarding the next-auth.session-token cookie. I need to automate the login process, which requires setting this cookie.
I've reviewed the documentation and understand that a JWT is created using the access token and other values, then serialized using the cookie.js module. However, I can't pinpoint the exact procedure to generate a session token from the access token.
Here's what I have:
- Access to the access token
- Access to NEXTAUTH_SECRET
Has anyone successfully created a session token from an access token for NextAuth? Any guidance or similar experiences would be greatly appreciated. Thanks!