Django-allauth: Use with React.js?

Created on 21 Jan 2018  路  4Comments  路  Source: pennersr/django-allauth

I'm developing all my frontend in React.js and not using Django templates.

The templates provided by django-allauth library is convenient, but I want to handle the Google login from my React.js app and not a page created with Django templates.

On the client side, I receive the access token, id token, and the code from Google, when a user does a google login. What I want to do is just send them to my Django server, login the user on the backend, and record this in the database.

How can I do this with django-allauth? Should I be looking at another library? Thanks!

All 4 comments

The situation here is that most of the views do accept AJAX requests (and will return AJAX responses in return). For the usual views, such as password reset & email management this can be used to build your SPA on top of (and this is already being used in production). As making the login fully AJAX based, your mileage may vary. The oauth views are redirect based, which collides with an SPA unless properly wrapped. There are also other projects building on top of allauth, such as django-rest-auth.

(closing ticket)

the oauth views are redirect based, which collides with an SPA unless properly wrapped

I am really interested in this part... Any insight I will be grateful

Is there any development on this? I am facing the same issue. Search the entire internet, but still no luck. Any help in this issue would be great. How to handle react from frontend and then backend from django-allauth?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aliabbas-2012 picture aliabbas-2012  路  6Comments

nordbit picture nordbit  路  5Comments

LukasKlement picture LukasKlement  路  4Comments

peterhn picture peterhn  路  4Comments

nlubega picture nlubega  路  4Comments