Open andresmrm opened 11 months ago
Just as an update, I opened another issue in allauth
with what I think is a little improved version of this code.
allauth.urls
enabled.SOCIALACCOUNT_AUTO_SIGNUP = True
sociallogin.connect
that seems better than what I did here.
Hi! I need to have strict control over user creation. No automatic sign-up/registration. The desired flow is:
At first I wanted to manually created all the required data for user registration before the user logins. But it looks like
allauth
creates data atsocialaccount
table with an ID that comes from Google login process.So I came up with the code bellow, that seems to work, but I would like to know if this is the recommended approach.
First I disabled
allauth.urls
anddj_rest_auth.urls
, as stated here, to restrict sign-ups. And then added only aGoogleLogin
view as stated in the docs.The auto_signup option seems required so I can decide in the
is_open_for_signup
if I want to accept the user.Until recently
allauth
had a scary warning related to using the email of an existent user. But I'm not sure if this applies to my case, since I'm only using Google for social login (besides regular local login).Thanks for the attention!