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: username onboarding on third party login/link #1966

Merged
merged 1 commit into from
Nov 6, 2024

Conversation

lfleischmann
Copy link
Member

@lfleischmann lfleischmann commented Nov 6, 2024

Description

If there is an existing user with a username and that user decides to link a third party account and username onboarding on login is enabled then logging in via third party results in a username onboarding prompt but if the user enters a username, then this leads to an error: if it is the same username it results in a "username already taken" error, if it is a different username it results in a technical error (unique constraint violation on the DB level because there already is a username for this user). The username prompt should not appear if the username is already set.

Implementation

There's already a check in place for ensuring that a username is set but the persister used to retrieve the identity does not preload the username, hence the check fails.

How to test

Do a before/after of:

  • Configure third party provider of your choice, configure it to allow linking
  • Enable usernames, set acquiring usernames on login to true
  • Create a user, set a username
  • Log in with third party provider
    • before: username is prompted for and the above mentioned errors occur when trying to set a username
    • after: username is not prompted for

@lfleischmann lfleischmann changed the title fix: username onboarding on third party login fix: username onboarding on third party login/link Nov 6, 2024
@lfleischmann lfleischmann merged commit 9b4c08a into main Nov 6, 2024
8 checks passed
@lfleischmann lfleischmann deleted the fix-username-onboarding-third-party branch November 6, 2024 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Recently closed
Development

Successfully merging this pull request may close these issues.

2 participants