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

Bug: unlinking all oauth providers breaks users login #28

Closed
GreenmeisterDavid opened this issue Oct 14, 2024 · 2 comments
Closed

Bug: unlinking all oauth providers breaks users login #28

GreenmeisterDavid opened this issue Oct 14, 2024 · 2 comments

Comments

@GreenmeisterDavid
Copy link
Contributor

Currently when a user unlinks all oauth providers they cannot login anymore. This is expected, but if they try to login with a new/different provider that has the same email address, the user will get an error along the lines of 'an account already exists with this email, login to that one and link it this provider'. This blocks them from logging in and renders the existing account inaccessible.

I suggest adding a simple check, both frontend and backend, before removing a provider. If that provider is the users' only method of logging in (the only auth provider linked), display an error.

Shall I create a pull request for this or is another way of handling this preferred?

💚

@Barbapapazes
Copy link
Owner

How does this happen?

There is already a security to avoid the user to remove all providers

Screenshot 2024-10-14 at 18 05 06

https://github.com/Barbapapazes/gavarnie/blob/main/server/api/me/providers/%5BproviderName%5D.delete.ts#L9

GreenmeisterDavid added a commit to GreenmeisterDavid/gavarnie that referenced this issue Oct 14, 2024
@GreenmeisterDavid
Copy link
Contributor Author

My bad, I forgot to add 'google' in the provider checks in my PR to add it, just committed a fix for it here; #27 .

Maybe we can centralize providers somewhat more to make it easier to add/remove them?

Closing this as its not relevant here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants