How to integrate social logins with existing user schema in my app (SPA + Custom API) using Auth0?

49 Views Asked by At

I have an app that uses the “Username-Password-Authentication” database connection (username and password to login), its successfully integrated with custom DB, i want to change the app so users can just register + login without ever needing to add a password or username, i want to remove the old method and use a social login (google) for this.

Here is my current solution (this app is only for learning purposes, i don’t need to actually migrate users from old to new login method):

Since flows in social logins are limited, i am only able to use the “Post Login” flow:

  • register social user to local db
  • if success → accept login
  • if user already exists → accept login
  • if fail (server errors) → reject login

Whats usually the general approach here? is my current solution ok?

I originally tried to asked this question here but moved to stackoverlfow since that website is currently very laggy and unusable for me

0

There are 0 best solutions below