Skip to content

Conversation

@LZoog
Copy link
Contributor

@LZoog LZoog commented Sep 24, 2025

Because:

  • Users in a non-Sync, non-2FA unverified session state are taken directly to Settings

This commit:

  • Adds a new env var for testing to simulate an account/session in this state
  • Adds a bandaid fix for what auth-server is returning in this state around 'verified', which directly references the session verification state, until a better solution is implemented in a follow up
  • Adds our new auth strategy to the 'account/attached_client/destroy' endpoint

closes FXA-12406
closes FXA-12402
closes partially? FXA-12361


I've sent DM's on Slack to Valerie/Dan about this PR. There is going to be a follow up issue I will file that explains some of the changes here and will correct them so we don't have to "bandaid" override what the server returns to us about the session state. I'll leave a note on the ticket as well for QA.

To test this, turn on the env var and sign up/verify an account normally. Sign out. Now when you sign in next with password, you'll get back an "unverified session" and you'll be taken to signin_token_code. Similarly you can test this on the cached sign in for that token.

I see locally there are a few settings tests failing around the key stretching upgrade - I think those will be quick to look at in the morning.

const skipTokenVerification = (request: AuthRequest, account: any) => {
// Skip all checks to simulate an unverified session token state
if (this.config.signinConfirmation.skipTokenVerification === true) {
return false;
Copy link
Contributor

Choose a reason for hiding this comment

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

The way this reads is confusing to me. The function is called skipTokenVerification and the config setting is called skipTokenVerification. When the config setting is true, the function returns false? Is that a mistake?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah it should, but I can update the name of this too since looking at it again it is a bit confusing. Basically this.config.signinConfirmation.skipTokenVerification is saying, "skip the checks done in this function and return the default" - and the default at the end of this function returns false.

Calling it skipSkipTokenVerification I guess is more accurate but is confusing too, so maybe this.config.signinConfirmation.tokenVerification with a default env var value of true, that when set to false it skips this and returns false, is more clear?

@LZoog LZoog force-pushed the FXA-12406-v2 branch 2 times, most recently from a65d3e8 to cee11da Compare September 24, 2025 18:42
@LZoog LZoog marked this pull request as ready for review September 24, 2025 18:43
@LZoog LZoog requested a review from a team as a code owner September 24, 2025 18:43
storeAccountData(accountData);
}

isVerified = await session.isSessionVerified();
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

@dschom dschom left a comment

Choose a reason for hiding this comment

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

We paired on this, and I think once the tests are passing, should be good to go. :shipit:

@LZoog LZoog force-pushed the FXA-12406-v2 branch 7 times, most recently from 3841d13 to db4677a Compare September 25, 2025 23:49
Because:
* Users in a non-Sync, non-2FA unverified session state are taken directly to Settings

This commit:
* Adds a new env var for testing to simulate an account/session in this state
* Adds a bandaid fix for what auth-server is returning in this state around 'verified', which directly references the session verification state, until a better solution is implemented in a follow up
* Adds our new auth strategy to the 'account/attached_client/destroy' endpoint

closes FXA-12406
testAccountTracker,
}) => {
const { email } = await signInSyncAccount(
const credentials = await testAccountTracker.signUp();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I stole these functional test changes from this PR we had to revert.

We have this exact test except non-Sync in our react conversion directory, which is passing... this was going through Sync. I tested it manually in Sync and without Sync and the cached signin works as expected.


@Query((returns) => SessionType)
@UseGuards(GqlAuthGuard)
@UseGuards(UnverifiedSessionGuard)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was changed because we could not use session.isSessionVerified in some unverified session cases where it would be false, because it would fail with a "Must Verify" error. The whole point was to check if it was verified or not.

@LZoog LZoog merged commit 103ccc7 into main Sep 26, 2025
19 checks passed
@LZoog LZoog deleted the FXA-12406-v2 branch September 26, 2025 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants