podkrepi-bg / api

Nest.js REST backend for charity platform Podkrepi.bg https://podkrepi.bg/swagger
https://podkrepi.bg
MIT License
82 stars 43 forks source link

[1/2]fix: Link existing users to identity providers on user exists error #640

Closed sashko9807 closed 1 month ago

sashko9807 commented 3 months ago

Whenever someone attempts to sign in through OAuth, keycloak automatically attempts to create a new user with the given user data returned from the provider. This behavior results in a conflict, in cases user had already been registered prior to Oauth2 Signin attempt.

Resolve this issue, by linking the existing user to the federated identity, whenever keycloak responds with an error "User already exists".

github-actions[bot] commented 3 months ago

✅ Tests will run for this PR. Once they succeed it can be merged.