cypress-nextjs-auth0
cypress-nextjs-auth0 copied to clipboard
[Feature] Support for Auth0 Organizations
Feature Request
Auth0 also provides logins to Organizations. Add cypress env var 'auth0OrganizationId'. The login() command will login to an organization if 'auth0OrganizationId' env var is set to an Auth0 organization id.
Basic example
Assign organization id env var to organization param. This is 'getUserTokens' command in 'get-user-tokens.js'.
auth.client.loginWithDefaultDirectory(
{
organization: Cypress.env('auth0OrganizationId'), // <-- add organization id
username,
password,
audience: Cypress.env('auth0Audience'),
scope: Cypress.env('auth0Scope'),
client_secret: Cypress.env('auth0ClientSecret'), // eslint-disable-line @typescript-eslint/camelcase
},
Motivation
Login to Organizations can be tested.