Skip to content
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
merged 1 commit into from
Jan 30, 2025

Conversation

coldlink
Copy link
Member

@coldlink coldlink commented Jan 16, 2025

What does this change?

Releases passcodes for sign in to all of the audience following on from #3034

We also remove the AB test and the usePasscodeSignIn query parameter which would've been needed in order to view the sign in with passcode page.

We add a usePasswordSignIn query parameter flag, which preserves the previous behaviour of sign in with a password directly on the initial sign in page. This is useful as it means tests can still continue to run without having to be integrated with passcodes for sign in.

Tested

  • DEV
  • CODE

@coldlink coldlink added the passwordless PRs/Issues related to passwordless/passcode functionality label Jan 16, 2025
@coldlink coldlink requested review from a team and removed request for a team January 16, 2025 15:28
@coldlink coldlink force-pushed the mm/passcode-signin-100 branch from eef0e8d to 8077e93 Compare January 16, 2025 15:39
@coldlink coldlink requested review from a team and removed request for a team January 16, 2025 15:39
@coldlink coldlink force-pushed the mm/passcode-signin-100 branch 2 times, most recently from 3524abe to de09457 Compare January 27, 2025 16:15
@coldlink coldlink marked this pull request as ready for review January 27, 2025 16:15
@coldlink coldlink requested a review from a team as a code owner January 27, 2025 16:15

try {
// only attempt to sign in with a passcode if the user currently has the query parameter set
// this should be removed when we're ready to enable this for all users
// only attempt to sign in with a passcode if we've enabled passcodes for all users
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this comment correct? it seems like this variable means that the user has not forced password sign in with the parameter, right ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated the comments on this page to make it clearer about whats going on!

@@ -417,6 +415,8 @@ export const oktaIdxApiSignInController = async ({
}
}

// Otherwise use password sign in
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the usePasswordSignIn flag is not set but there's no passcode in the request body then it would attempt password sign in ? is this the desired behaviour ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's right. It only attempts to use passcodes if it sees the passcode in the request params, which is just a hidden flag saying to use the passcode flow rather than the password flow

res.locals.queryParams.usePasscodeSignIn ||
res.locals.abTestAPI.isUserInVariant('PasscodeSignInTest', 'variant');
// we're using passwords if the `usePasswordSignIn` query parameter is set
const usePasscodeSignInFlag = !res.locals.queryParams.usePasswordSignIn;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keeping the usePasscodeSignInFlag might be confusing now that it means that the usePasswordSignIn was NOT set

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added comments and updated the name to make it clearer about what's going on!

@coldlink coldlink force-pushed the mm/passcode-signin-100 branch from de09457 to 08a4dac Compare January 29, 2025 14:08
@coldlink coldlink requested a review from a team January 29, 2025 14:10
// get the email and password from the request body
// get the email and password from the request body if using passwords
// or the "passcode" parameter is a hidden input, which is to determine if the
// user is signing in with a passcode and not an actual passcode value
Copy link
Contributor

@pvighi pvighi Jan 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// or the "passcode" parameter is a hidden input, which is to determine if the
// user is signing in with a passcode and not an actual passcode value

I don't really understand this last sentence.. what is the difference between passcode and an actual passcode value?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not a "code" like "123456", but a key/value set to passcode coming from:

<input type="hidden" name="passcode" value="passcode" />

@@ -4,7 +4,7 @@ describe('Delete my account flow in Okta', () => {
cy.visit(
`/signin?returnUrl=${encodeURIComponent(
`https://${Cypress.env('BASE_URI')}/welcome/review`,
)}`,
)}&usePasswordSignIn=true`,
Copy link
Contributor

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 ?

Copy link
Member Author

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.

Copy link
Contributor

@pvighi pvighi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added some comments but in general it looks good to me

@coldlink coldlink merged commit 9b556af into main Jan 30, 2025
21 checks passed
@coldlink coldlink deleted the mm/passcode-signin-100 branch January 30, 2025 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
passwordless PRs/Issues related to passwordless/passcode functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants