Closed HugoRCD closed 16 hours ago
In the onSuccess
callback of the OAuth provider, you can check if the user is already authenticated using the getUserSession(event)
if this is the case, you can "link" the account in your database then.
You may want to add a security layer for example if they don't match the same email for example (not required of course).
Reference in new issue
I'm sorry, I don't know if I've misunderstood your answer or if I've explained my question incorrectly, but I'm talking about the case where a user with several Google or Github accounts, for example, who has accepted the oauth window, disconnects and wants to use another of his Google accounts. Is this case manageable?
If the user logout and click on the Google login again, it will be redirect to Google page to select an account, that's it.
See the example with https://draw.nuxt.dev (see source code):
https://github.com/user-attachments/assets/ee00f5a6-938f-4d42-bc1a-4878c15e7307
I'm really sorry, I realized that it was simply because I only had one Google account on my machine, but yes indeed, with several it works like a charm!
If a user has already signed in to my application and accepted the OAuth authorization, how should I handle the situation if they have multiple accounts and wish to connect with a different one?