Auth0 Cypress testing with ServerSideRendering

I’m currently we’re having a problem using Auth0 together with cypress End to End testing using Nejxt JS. Hope you could help us and give some information and advice. Summary of the Inquiry, the Auth0 is not able to run or pass on cypress e2e when its move to serverSideRendering it always throws us an errors. Below are the current versions and used libraries:

  • Next JS → “next”: “^13.1.1”
  • Auth0 → “@auth0/nextjs-auth0”: “^2.0.1”
  • Cypress → “cypress”: “^12.3.0”,

The Following are the Errors and Steps we have done so far:

  1. When Auth0 (Authentication) on client side it works fine.
  2. When Auth0 (Authentication) moved to serverSideRendering. (code below)

Steps and Things Done so far:

  1. Manually login in the user whic the credentials.
  • followed this docs and article. (https://auth0.com/blog/end-to-end-testing-with-cypress-and-auth0/)
  • I was able to get a access_token, id_token, expires, token: “bearer”, date
  • but trying to manually add it to session using cy.session() its not able to redirect the user or login the user. Stuck on the same screen even using cy.visit()
    [image]
  • Screen Behavior:
    [image]
  1. Tried to use direct login without cy.origin, cy.visit
    [image]
  • stuck on the same page it has an error, that callback not be called.
  1. Tried the this one as well the login with forms.
    [image]
  • but were having an error on callback and its having 400 which not allowed us to deploy since it has an error. (error below)

[image]

  1. Tried also to cy.visit into a callback after getting a token.

A post was merged into an existing topic: End-to-End Testing with Cypress and Auth0