-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Passcodes | Release sign in with passcodes to all users #3035
Merged
+90
−108
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,7 +85,7 @@ describe('Sign in flow, Okta enabled', () => { | |
cy.url().should('eq', guardianJobsPrivacyPolicyUrl); | ||
}); | ||
it('navigates to reset password', () => { | ||
cy.visit('/signin'); | ||
cy.visit('/signin?usePasswordSignIn=true'); | ||
cy.contains('Reset password').click(); | ||
cy.contains('Reset password'); | ||
}); | ||
|
@@ -120,7 +120,7 @@ describe('Sign in flow, Okta enabled', () => { | |
cy.url().should('contain', 'clientId=jobs'); | ||
}); | ||
it('applies form validation to email and password input fields', () => { | ||
cy.visit('/signin'); | ||
cy.visit('/signin?usePasswordSignIn=true'); | ||
|
||
cy.get('form').within(() => { | ||
cy.get('input:invalid').should('have.length', 2); | ||
|
@@ -292,7 +292,7 @@ describe('Sign in flow, Okta enabled', () => { | |
cy.visit( | ||
`/signin?returnUrl=${encodeURIComponent( | ||
`https://${Cypress.env('BASE_URI')}/welcome/review`, | ||
)}`, | ||
)}&usePasswordSignIn=true`, | ||
); | ||
cy.get('input[name=email]').type(emailAddress); | ||
cy.get('input[name=password]').type(finalPassword); | ||
|
@@ -317,7 +317,7 @@ describe('Sign in flow, Okta enabled', () => { | |
}); | ||
}); | ||
|
||
context('Okta IDX API Sign In', () => { | ||
context('Okta IDX API Sign In with Password', () => { | ||
it('ACTIVE user - email + password authenticators - successfully sign in', () => { | ||
// Intercept the external redirect page. | ||
// We just want to check that the redirect happens, not that the page loads. | ||
|
@@ -329,7 +329,7 @@ describe('Sign in flow, Okta enabled', () => { | |
isUserEmailValidated: true, | ||
}) | ||
?.then(({ emailAddress, finalPassword }) => { | ||
cy.visit('/signin'); | ||
cy.visit('/signin?usePasswordSignIn=true'); | ||
cy.get('input[name=email]').type(emailAddress); | ||
cy.get('input[name=password]').type(finalPassword); | ||
cy.get('[data-cy="main-form-submit-button"]').click(); | ||
|
@@ -348,7 +348,9 @@ describe('Sign in flow, Okta enabled', () => { | |
isUserEmailValidated: true, | ||
}) | ||
?.then(({ emailAddress, finalPassword }) => { | ||
cy.visit(`/signin?returnUrl=${encodeURIComponent(returnUrl)}`); | ||
cy.visit( | ||
`/signin?returnUrl=${encodeURIComponent(returnUrl)}&usePasswordSignIn=true`, | ||
); | ||
cy.get('input[name=email]').type(emailAddress); | ||
cy.get('input[name=password]').type(finalPassword); | ||
cy.get('[data-cy="main-form-submit-button"]').click(); | ||
|
@@ -376,9 +378,11 @@ describe('Sign in flow, Okta enabled', () => { | |
isUserEmailValidated: true, | ||
}) | ||
?.then(({ emailAddress, finalPassword }) => { | ||
cy.visit(`/signin?returnUrl=${encodeURIComponent(returnUrl)}`); | ||
cy.visit( | ||
`/signin?returnUrl=${encodedReturnUrl}&appClientId=${appClientId}&fromURI=${fromURI}`, | ||
`/signin?returnUrl=${encodeURIComponent(returnUrl)}&usePasswordSignIn=true`, | ||
); | ||
cy.visit( | ||
`/signin?returnUrl=${encodedReturnUrl}&appClientId=${appClientId}&fromURI=${fromURI}&usePasswordSignIn=true`, | ||
); | ||
cy.get('input[name=email]').type(emailAddress); | ||
cy.get('input[name=password]').type(finalPassword); | ||
|
@@ -444,7 +448,7 @@ describe('Sign in flow, Okta enabled', () => { | |
cy.contains(emailAddress.toLowerCase()); | ||
|
||
// setup complete, now sign in | ||
cy.visit('/signin'); | ||
cy.visit('/signin?usePasswordSignIn=true'); | ||
cy.contains('Sign in with a different email').click(); | ||
cy.get('input[name=email]').clear().type(emailAddress); | ||
cy.get('input[name=password]').type(password); | ||
|
@@ -494,7 +498,7 @@ describe('Sign in flow, Okta enabled', () => { | |
isUserEmailValidated: true, | ||
}) | ||
?.then(({ emailAddress, finalPassword }) => { | ||
cy.visit('/signin'); | ||
cy.visit('/signin?usePasswordSignIn=true'); | ||
cy.get('input[name=email]').type(emailAddress); | ||
cy.get('input[name=password]').type(`${finalPassword}!`); | ||
cy.get('[data-cy="main-form-submit-button"]').click(); | ||
|
@@ -503,7 +507,7 @@ describe('Sign in flow, Okta enabled', () => { | |
}); | ||
|
||
it('NON-EXISTENT user - shows authentication error in all scenarios', () => { | ||
cy.visit('/signin'); | ||
cy.visit('/signin?usePasswordSignIn=true'); | ||
cy.get('input[name=email]').type('[email protected]'); | ||
cy.get('input[name=password]').type('password'); | ||
cy.get('[data-cy="main-form-submit-button"]').click(); | ||
|
@@ -519,7 +523,7 @@ describe('Sign in flow, Okta enabled', () => { | |
cy | ||
.createTestUser({ isGuestUser: true }) | ||
?.then(({ emailAddress, finalPassword }) => { | ||
cy.visit('/signin'); | ||
cy.visit('/signin?usePasswordSignIn=true'); | ||
cy.get('input[name=email]').type(emailAddress); | ||
cy.get('input[name=password]').type(`${finalPassword}`); | ||
cy.get('[data-cy="main-form-submit-button"]').click(); | ||
|
@@ -562,7 +566,7 @@ describe('Sign in flow, Okta enabled', () => { | |
cy.visit( | ||
`/signin?returnUrl=${encodeURIComponent( | ||
`https://${Cypress.env('BASE_URI')}/welcome/review`, | ||
)}`, | ||
)}&usePasswordSignIn=true`, | ||
); | ||
cy.get('input[name=email]').type(emailAddress); | ||
cy.get('input[name=password]').type(finalPassword); | ||
|
@@ -597,7 +601,7 @@ describe('Sign in flow, Okta enabled', () => { | |
isUserEmailValidated: true, | ||
}) | ||
?.then(({ emailAddress, finalPassword }) => { | ||
cy.visit('/signin'); | ||
cy.visit('/signin?usePasswordSignIn=true'); | ||
|
||
cy.interceptRecaptcha(); | ||
|
||
|
@@ -656,7 +660,7 @@ describe('Sign in flow, Okta enabled', () => { | |
cy.visit( | ||
`/signin?returnUrl=${encodeURIComponent( | ||
`https://${Cypress.env('BASE_URI')}/welcome/review`, | ||
)}`, | ||
)}&usePasswordSignIn=true`, | ||
); | ||
cy.get('input[name=email]').type(emailAddress); | ||
cy.get('input[name=password]').type(finalPassword); | ||
|
@@ -702,7 +706,7 @@ describe('Sign in flow, Okta enabled', () => { | |
cy.visit( | ||
`/signin?returnUrl=${encodeURIComponent( | ||
`https://${Cypress.env('BASE_URI')}/welcome/review`, | ||
)}`, | ||
)}&usePasswordSignIn=true`, | ||
); | ||
cy.get('input[name=email]').type(emailAddress); | ||
cy.get('input[name=password]').type(finalPassword); | ||
|
@@ -748,7 +752,7 @@ describe('Sign in flow, Okta enabled', () => { | |
cy.visit( | ||
`/signin?returnUrl=${encodeURIComponent( | ||
`https://${Cypress.env('BASE_URI')}/welcome/review`, | ||
)}`, | ||
)}&usePasswordSignIn=true`, | ||
); | ||
cy.get('input[name=email]').type(emailAddress); | ||
cy.get('input[name=password]').type(finalPassword); | ||
|
@@ -780,7 +784,7 @@ describe('Sign in flow, Okta enabled', () => { | |
cy.visit( | ||
`/signin?returnUrl=${encodeURIComponent( | ||
`https://${Cypress.env('BASE_URI')}/welcome/review`, | ||
)}`, | ||
)}&usePasswordSignIn=true`, | ||
); | ||
cy.get('input[name=email]').type(emailAddress); | ||
cy.get('input[name=password]').type(finalPassword); | ||
|
@@ -851,7 +855,7 @@ describe('Sign in flow, Okta enabled', () => { | |
cy.visit( | ||
`/signin?returnUrl=${encodeURIComponent( | ||
`https://${Cypress.env('BASE_URI')}/welcome/review`, | ||
)}`, | ||
)}&usePasswordSignIn=true`, | ||
); | ||
cy.get('input[name=email]').type(emailAddress); | ||
cy.get('input[name=password]').type(finalPassword); | ||
|
@@ -912,7 +916,7 @@ describe('Sign in flow, Okta enabled', () => { | |
)}/welcome/review`; | ||
const visitUrl = `/signin?returnUrl=${encodeURIComponent( | ||
postSignInReturnUrl, | ||
)}`; | ||
)}&usePasswordSignIn=true`; | ||
cy.visit(visitUrl); | ||
cy.get('input[name=email]').type(emailAddress); | ||
cy.get('input[name=password]').type(finalPassword); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
describe('POST requests return a user-facing error message when encountering a rate limit from Okta', () => { | ||
specify('Submit /signin', () => { | ||
cy.visit('/signin'); | ||
cy.visit('/signin?usePasswordSignIn=true'); | ||
cy.get('input[name="email"]').type('[email protected]'); | ||
cy.get('input[name="password"]').type('password'); | ||
|
||
|
@@ -16,7 +16,7 @@ describe('POST requests return a user-facing error message when encountering a r | |
}); | ||
|
||
specify('Submit /reauthenticate', () => { | ||
cy.visit('/reauthenticate'); | ||
cy.visit('/reauthenticate?usePasswordSignIn=true'); | ||
cy.get('input[name="email"]').type('[email protected]'); | ||
cy.get('input[name="password"]').type('password'); | ||
|
||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this mean we are not testing the default sign in method now ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are! It's just in other test files that have already been added. Adding
usePasswordSignIn
to tests just means we don't have to update the authentication specific tests, e.g. for delete my account.