Carlos
Carlos

Reputation: 6021

Django-allauth: Getting a local account after setting up a social account

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.

Upvotes: 4

Views: 1970

Answers (1)

TakeLong
TakeLong

Reputation: 104

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

Upvotes: 5

Related Questions