thefrontside / simulacrum

A simulation platform for use during testing, during development and for high-fidelity application previews
89 stars 14 forks source link

Get user tokens #162

Closed dagda1 closed 2 years ago

dagda1 commented 2 years ago

Motivation

This PR enables the auth0 cypress plugin to run against both nextjs-auth0 and auth0-react.

Approach

Chuck brought this package to my attention which currently requires a real auth0 account.

The repo uses a slightly different approach that does not require getTokenSilently and also provides a helper to encrypt the nextjs-auth0 session in a cypress cookie that was the root of the problems I had before bringing our version in line with this code.

It also makes use of the openid connect endpoint /userinfo which we probably could get away with not using but I've implemented it for completeness.

Chuck said he knows the author and it might be an idea to reach out to him after using his approach.

I'm also now running the tests against both the /nextjs-auth0 and auth0-react example repos.

TODOs and Open Questions

I still have a bug when running cypress in the browser and if the tests are kicked off again after a successful run.

I will fix that on a separate PR.

netlify[bot] commented 2 years ago

✔️ Deploy Preview for simulacrum canceled.

🔨 Explore the source changes: 1e5eb40bc0b7dda4c6edf3297055525f83838e9b

🔍 Inspect the deploy log: https://app.netlify.com/sites/simulacrum/deploys/61d42fb39de90f0007ef1a02