From 4601077dfb125900141c5e50bc02e4ca079cd3fa Mon Sep 17 00:00:00 2001 From: Bill Glesias Date: Fri, 5 Dec 2025 15:48:03 -0500 Subject: [PATCH] chore: update auth examples to reflect RWA changes --- .../amazon-cognito-authentication.mdx | 6 +++--- .../authentication-testing/auth0-authentication.mdx | 6 +++--- .../azure-active-directory-authentication.mdx | 10 +++++----- .../authentication-testing/google-authentication.mdx | 10 +++++----- .../authentication-testing/okta-authentication.mdx | 12 ++++++------ 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/docs/app/guides/authentication-testing/amazon-cognito-authentication.mdx b/docs/app/guides/authentication-testing/amazon-cognito-authentication.mdx index cb24359e4c..d4d4711a4d 100644 --- a/docs/app/guides/authentication-testing/amazon-cognito-authentication.mdx +++ b/docs/app/guides/authentication-testing/amazon-cognito-authentication.mdx @@ -163,7 +163,7 @@ const awsConfig = require('./aws-exports-es5.js') }, setupNodeEvents(on, config) { on('task', { - getAuthCredentials() { + getCognitoCredentials() { const username = process.env.AWS_COGNITO_USERNAME const password = process.env.AWS_COGNITO_PASSWORD if (!username || !password) { @@ -264,7 +264,7 @@ describe('Cognito, cy.origin() login', function () { cy.task('db:seed') // login via Amazon Cognito via cy.origin() - cy.task('getAuthCredentials').then(({ username, password }) => { + cy.task('getCognitoCredentials').then(({ username, password }) => { cy.loginByCognito(username, password) }) }) @@ -464,7 +464,7 @@ describe('Cognito, programmatic login', function () { cy.task('db:seed') // Programmatically login via Amazon Cognito API - cy.task('getAuthCredentials').then(({ username, password }) => { + cy.task('getCognitoCredentials').then(({ username, password }) => { cy.loginByCognitoApi(username, password) }) }) diff --git a/docs/app/guides/authentication-testing/auth0-authentication.mdx b/docs/app/guides/authentication-testing/auth0-authentication.mdx index e19719c10d..2b029be42c 100644 --- a/docs/app/guides/authentication-testing/auth0-authentication.mdx +++ b/docs/app/guides/authentication-testing/auth0-authentication.mdx @@ -97,7 +97,7 @@ require('dotenv').config() }, setupNodeEvents(on, config) { on('task', { - getAuthCredentials() { + getAuth0Credentials() { const username = process.env.AUTH0_USERNAME const password = process.env.AUTH0_PASSWORD if (!username || !password) { @@ -195,7 +195,7 @@ describe('Auth0', function () { cy.task('db:seed') cy.intercept('POST', '/graphql').as('createBankAccount') - cy.task('getAuthCredentials').then(({ username, password }) => { + cy.task('getAuth0Credentials').then(({ username, password }) => { cy.loginToAuth0(username, password) }) cy.visit('/') @@ -342,7 +342,7 @@ onboarding process and logout. describe('Auth0', function () { beforeEach(function () { cy.task('db:seed') - cy.task('getAuthCredentials').then(({ username, password }) => { + cy.task('getAuth0Credentials').then(({ username, password }) => { cy.loginByAuth0Api(username, password) }) }) diff --git a/docs/app/guides/authentication-testing/azure-active-directory-authentication.mdx b/docs/app/guides/authentication-testing/azure-active-directory-authentication.mdx index e65b55cefe..1670a4b259 100644 --- a/docs/app/guides/authentication-testing/azure-active-directory-authentication.mdx +++ b/docs/app/guides/authentication-testing/azure-active-directory-authentication.mdx @@ -82,7 +82,7 @@ authentication workflow will enter an infinite redirect loop. }, setupNodeEvents(on, config) { on('task', { - getAuthCredentials() { + getAADCredentials() { const username = process.env.AAD_USERNAME const password = process.env.AAD_PASSWORD if (!username || !password) { @@ -157,7 +157,7 @@ function loginViaAAD(username: string, password: string) { // Ensure Microsoft has redirected us back to the sample app with our logged in user. cy.url().should('equal', 'http://localhost:3000/') - cy.task('getAuthCredentials').then(({ username }) => { + cy.task('getAADCredentials').then(({ username }) => { cy.get('#welcome-div').should( 'contain', `Welcome ${username}!` @@ -187,7 +187,7 @@ as a user via Azure Active Directory and run a basic sanity check. describe('Azure Active Directory Authentication', () => { beforeEach(() => { // log into Azure Active Directory through our sample SPA using our custom command - cy.task('getAuthCredentials').then(({ username, password }) => { + cy.task('getAADCredentials').then(({ username, password }) => { cy.loginToAAD(username, password) }) cy.visit('http://localhost:3000') @@ -200,7 +200,7 @@ describe('Azure Active Directory Authentication', () => { }) it('verifies the user logged in has the correct preferred name', () => { - cy.task('getAuthCredentials').then(({ username }) => { + cy.task('getAADCredentials').then(({ username }) => { cy.get('#table-body-div td:contains("preferred_username") + td').should( 'contain', username @@ -247,7 +247,7 @@ Cypress.Commands.add('loginToAAD', (username: string, password: string) => { // this is a very basic form of session validation for this demo. // depending on your needs, something more verbose might be needed cy.visit('http://localhost:3000') - cy.task('getAuthCredentials').then(({ username }) => { + cy.task('getAADCredentials').then(({ username }) => { cy.get('#welcome-div').should('contain', `Welcome ${username}!`) }) }, diff --git a/docs/app/guides/authentication-testing/google-authentication.mdx b/docs/app/guides/authentication-testing/google-authentication.mdx index faae8b9cbe..6342a02846 100644 --- a/docs/app/guides/authentication-testing/google-authentication.mdx +++ b/docs/app/guides/authentication-testing/google-authentication.mdx @@ -105,15 +105,15 @@ require('dotenv').config() ```js { env: { - googleClientId: process.env.REACT_APP_GOOGLE_CLIENTID, + googleClientId: process.env.VITE_GOOGLE_CLIENTID, }, setupNodeEvents(on, config) { on('task', { - getGoogleAuthCredentials() { - const clientSecret = process.env.REACT_APP_GOOGLE_CLIENT_SECRET + getGoogleCredentials() { + const clientSecret = process.env.VITE_GOOGLE_CLIENT_SECRET const refreshToken = process.env.GOOGLE_REFRESH_TOKEN if (!clientSecret || !refreshToken) { - throw new Error('REACT_APP_GOOGLE_CLIENT_SECRET and GOOGLE_REFRESH_TOKEN must be set') + throw new Error('VITE_GOOGLE_CLIENT_SECRET and GOOGLE_REFRESH_TOKEN must be set') } return { clientSecret, refreshToken } }, @@ -145,7 +145,7 @@ The `loginByGoogleApi` command will execute the following steps: ```jsx title="cypress/support/commands.js" Cypress.Commands.add('loginByGoogleApi', () => { cy.log('Logging in to Google') - cy.task('getGoogleAuthCredentials').then(({ clientSecret, refreshToken }) => { + cy.task('getGoogleCredentials').then(({ clientSecret, refreshToken }) => { cy.request({ method: 'POST', url: 'https://www.googleapis.com/oauth2/v4/token', diff --git a/docs/app/guides/authentication-testing/okta-authentication.mdx b/docs/app/guides/authentication-testing/okta-authentication.mdx index 2e55e46f94..6b41557098 100644 --- a/docs/app/guides/authentication-testing/okta-authentication.mdx +++ b/docs/app/guides/authentication-testing/okta-authentication.mdx @@ -51,11 +51,11 @@ require('dotenv').config() }, setupNodeEvents(on, config) { on('task', { - getAuthCredentials() { - const username = process.env.AUTH_USERNAME - const password = process.env.AUTH_PASSWORD + getOktaCredentials() { + const username = process.env.OKTA_USERNAME + const password = process.env.OKTA_PASSWORD if (!username || !password) { - throw new Error('AUTH_USERNAME and AUTH_PASSWORD must be set') + throw new Error('OKTA_USERNAME and OKTA_PASSWORD must be set') } return { username, password } }, @@ -131,7 +131,7 @@ is in the . describe('Okta', function () { beforeEach(function () { cy.task('db:seed') - cy.task('getAuthCredentials').then(({ username, password }) => { + cy.task('getOktaCredentials').then(({ username, password }) => { cy.loginByOkta(username, password) }) }) @@ -251,7 +251,7 @@ process and logout. describe('Okta', function () { beforeEach(function () { cy.task('db:seed') - cy.task('getAuthCredentials').then(({ username, password }) => { + cy.task('getOktaCredentials').then(({ username, password }) => { cy.loginByOktaApi(username, password) }) })