Currently, the username
property is unique on User
model. It takes the value of the GitHub username.
However, it starts to cause issues when linking GitHub account (we need to check if the username doesn't already exist in the DB, besides the account ID). If we want to support more signin methods in the future, this will also likely cause issues (possible collisions of username).
I see two approaches to improve this situation:
username
This would make username
a pure display value without any strong semantics behind.
For the few places where we currently rely on the unique GitHub username
(in particular get_user_by_github_username), we can simply store it on OAuthAccount
model.
Pros
Cons
@fvoron
) in potential future features of Polarusername
unique, but then keep it stableIf we want to keep it unique, we have to make it stable and not update it whenever the user logs in with GitHub. Said another way, we should have our own "usernames list" and have features to manage it (ask for a username on signup, have a setting to change it, etc.).
Pros
@fvoron
) in potential future features of PolarCons
Assume that we'll probably stick only with GitHub, so things can stay as they are.
Pros
Cons
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too