-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Add frontend code to merge users #3488
base: main
Are you sure you want to change the base?
Conversation
logger.info({ message: "Merging user accounts", frontendId, accounts, backendIds }); | ||
let remainingIds: string[]; | ||
|
||
[backendId, ...remainingIds] = backendIds; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here I am just taking the first, maybe there is a better idea.
Thanks but I am really against this decision. The backend should depend on the frontend, just like the inference is doing now. |
I do see the value of using the frontend id, since the frontend for the time being is the central service where all accounts are stored (without duplicates) If we want to add discord bot support to the inference, we would still have the duplication problem, but now in the inference not in the data backend. As long as any given user could have multiple accounts, we need a way to identify them across all services in our stack, which means we need a central service for auth. In our current state, this service could be the frontend, but could also be the data backend, which does not make a big difference from an architectural point of view. I could see us separating the auth part from the frontend to its own service, which is used by any component we want. I am very interested in your ideas. |
I agree with @AbdBarho to make the frontend as an auth service since it is the entry point of our app and we also can reuse the next auth logic.
I'm calling it the backend depend on the frontend because the frontend doesn't need to talk to the backend to authenticate the user. And the backend just simply trusts whatever the frontend sends since it already authenticated. Here is my idea for the migration
These steps can be simplified if we use the
The discord bot needs to communicate with the frontend for authentication. There is no way you can avoid this behavior in microservice. |
Adds the ability to merge users in the frontend. Refs #3246
The code is ready (and I tested it locally) but is currently not used anywhere.
We need to update the way we communicate with the backend before we can use this. I am also unsure what would be the best place to run this code.
Should we allow the users to execute this? or should we just manually trigger it for all users and then forget about it. What about when we generate the JWT?
Maybe as a final step, I want to add some stuff to the account page to show the different accounts, and maybe make it easier to link/unlink accounts. #3073