Show account linking page for social sign in guest users #2739
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.
What does this change?
Currently users who are "guest" accounts (i.e users in Okta who are not in the
ACTIVE
state) get blocked from authenticating with a social identity provider by Okta. Okta returns an error to us with theerror=access_denied&error_description=User+status+is+invalid.
query parameters, however this error was not being handled correctly, and users were either being show a "Not Found" or "Error" page, which wasn't proving to be great UX.Ideally we'd rectify the issue when the user authenticates, however all of social authentication happens through Okta, and all we get back from Okta is either a success (user created and authenticated) or failure (something went wrong). We're still investigating how best we should manage this.
For now we should improve the user experience. In Gateway we already have the "Account Linking" failed page for social users for a different purpose (if the user wasn't in the correct group). This page doesn't have social buttons, only email and password, and an error message explaining that we were unable to sign in with social and to use email and password instead.
This PR now handles the specific error correctly, and we also redirect to this account linking denied page. We also expand the error message to suggest reseting their password, or contacting support. We also handle any other OAuth errors using our generic handler.
Screen.Recording.2024-05-23.at.15.42.30.mov
Tested