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

Fix initializing TrnLookup from an existing session #756

Merged
merged 1 commit into from
Nov 3, 2023

Conversation

gunndabad
Copy link
Collaborator

We have some Sentry errors caused by users hitting the /sign-in/register/email-exists after the /sign-in/email-confirmation. That shouldn't be possible; we shouldn't be showing the 'you already have an account' interstitial when users have chosen to sign in, only when they've tried to register.

I think this might be caused by the AuthenticationState initialization we do from an existing cookie - clearing cookies and signing in doesn't seem to show this issue.

The IsFinished() check that we do to know we're done requires AuthenticationState.TrnLookup to be Complete. For users who registered via magic link this will be false since CompletedTrnLookup will be false. This change updates the initialization to set TrnLookup to Complete whenever Trn is not null.

@gunndabad gunndabad requested a review from MrKevJoy November 3, 2023 14:22
@gunndabad gunndabad enabled auto-merge (squash) November 3, 2023 14:24
@gunndabad gunndabad merged commit 0b1fce5 into main Nov 3, 2023
6 checks passed
@gunndabad gunndabad deleted the fix-authstate-init-from-cookie branch November 3, 2023 14:31
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.

2 participants