1

In my application, a user can signup by completing a form or by using a provider (facebook, google, etc.). The main difference is that the user signing up by form will have a password, while the one using a social account will not.

I am not sure how to deal with the user model in the db. Should there be 2 separate tables, for each type of signup?

There is also the case of linking a normal account to a social account.

Never Mind
  • 185
  • 1
  • 14

1 Answers1

0

No a single table will suffice.
When the user signs up with the form, You save his info with the password he registered,
And when he signs with the provider, You only save what the user allows you to save
(email,profile picture, etc..).

And regarding the linking problem you can just make an option to merge accounts like here in stackoverflow.

Makdous
  • 1,447
  • 1
  • 12
  • 24