4

I found this answer for the opposite scenario: django-allauth: Linking multiple social accounts to a single user

Ie. where a local user can connect a social account. Is there a simple way to get a local account after having created the account via social login?

I'm thinking that some of my users will get confused and try to sign up for a local account after having used their social auth to set up, and quite often they will want to sign up with the same email address, which I'm currently enforcing as unique.

Community
  • 1
  • 1
Carlos
  • 5,991
  • 6
  • 43
  • 82

1 Answers1

5

Upon social connect, Allauth collects data like username, email, etc. from the social site that you've allowed and stores it locally except for password.

You may then set your password by going to

/accounts/password/set/

then you may login using your email and the password you've set

By adding in your settings.py

ACCOUNT_AUTHENTICATION_METHOD = “username_email”

You may login using email or username and the username is the same with that username in your social account.

As for them trying to signup using the same email,

"A user is already registered with this e-mail address"

error will show up if the email has been used already

TakeLong
  • 104
  • 3
  • I'm exclusively using email as the identifier, rather than username. I think you may have misunderstood the question. I actually need to be able to add a local account after the user has created a login under the same email using a social account. – Carlos Jul 10 '14 at 09:57
  • Apologies, you are right. However, the answer only needs to go up to the first URL. I was confused by the rest. I've just tried to create a social account, then set the local password, then log in using the email and the newly set password. – Carlos Jul 26 '14 at 16:40