LAION-AI / LAION-AI/Open-Assistant
User accounts deduping
@andreaskoepf is already working on this.
Since Jun 14, 2023.
- Dominant language
- Python
- Stars
- 37.4k
- Forks
- 3.3k
- PR merge metrics
- No merged PRs in 30d
Description
Context
There are some users who are facing problem when logged in through multiple methods, i.e. email first and then google / discord second, or the other way around.
https://github.com/LAION-AI/Open-Assistant/issues/3136 https://github.com/LAION-AI/Open-Assistant/issues/3232 #2637 #1695 #1268 and probably many more. We don't want their efforts to go to waste.
In the frontend db we have users and accounts, in theory, it should be possible for a user to have multiple accounts from different providers and still be the same user.
However, the way we identify users in the data backend is a combination of user id and auth method, which makes it harder to reconnect the two.
This problem is more pronounced when taking the discord bot into consideration, since it has no information about the user other than their discord id.
For chat, we only use the user's frontend db id, which should make it easier.
Solution Idea
Ideally, we should be able to identify a user through our entire stack using a single piece of information, which is identical through all auth methods we provide.
I see the email address being the only valid option (users might change their emails), which is used by next-auth for connecting multiple accounts to the same user.
This would require at least:
- Update user auth frontend <--> data backend
- Change auth headers sent
- Merge potential duplicate users using their email addresses while preserving their contributions & privileges
- Update tables
- Update user auth frontend <--> inference
This will probably be a gradual process where we would have to support both old and new formats while we do the migration.
Open questions
- What should this unique identifier be
- email?
- id of user in frontend db (since it is the entrypoint for all user interactions)
- Or maybe a separate "user" service?
- Are there some solutions out there that already solve this problem?
@andreaskoepf @yk @notmd @olliestanley would love to hear your opinions on this, since it is a huge topic and basically touches everything.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.