Hi all,
I’m trying to use social logins to authenticate a user and register a new user. I tried Django all-auth and it works in terms of creating a user but now I want this to be done via front-end React.
When a front-end calls the login endpoint I redirect it to accounts/google/login this works fine.
Now in my Google console, the only redirect URL that works is HTTP://localhost:8000/accounts/google/login/callback/, I tried setting a custom callback but it fails all the time.
Now what I want to do is that in callback from Google I want to get the user info like first name, last name, and email and redirect it to the front end either via session or jwt, how can I do that?
I have found things that are only django template-friendly and don’t work well.
Or should I remove all auth (useless) and use google.oauth2? and do things in my customized way?
#The following are my settings:
SOCIALACCOUNT_PROVIDERS = {
'google': {
'SCOPE': {
'profile',
'email',
},
'CLIENT_ID': '',
'SECRET': '',
}
}
#The following are my urls:
path('accounts/', include('allauth.urls')),