Skip to content

Commit

Permalink
Merge pull request #3030 from guardian/mm/fix-signin-okta-classic-flag
Browse files Browse the repository at this point in the history
Fix | `useOktaClassic` query param on sign in page
  • Loading branch information
coldlink authored Jan 15, 2025
2 parents f422359 + 2b0ca9b commit 19301aa
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/client/pages/SignInPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,30 @@ export const SignInPage = ({
// we use the encryptedEmail parameter to pre-fill the email field, but then want to remove it from the url
useRemoveEncryptedEmailParam();

// determines if the passcode view of the sign in page should be shown
const usePasscodeSignIn: boolean = (() => {
// if the forcePasswordPage flag is set, we should always show the password view
// for example when the user clicks "sign in with password instead"
if (forcePasswordPage) {
return false;
}

// if the useOktaClassic flag is set, we should always show the password view
// to maintain the existing behaviour
if (queryParams.useOktaClassic) {
return false;
}

// if the user is in the PasscodeSignInTest variant, we should show the passcode view
// to test the new sign in flow
// eventually this will be removed and the passcode view will be shown by default
if (ABTestAPI.isUserInVariant('PasscodeSignInTest', 'variant')) {
return true;
}

// if the usePasscodeSignIn query param is set, we should show the passcode view
// this is used for testing the new sign in flow
// eventually this will be removed and the passcode view will be shown by default
return !!queryParams.usePasscodeSignIn;
})();

Expand Down

0 comments on commit 19301aa

Please sign in to comment.