[QUESTION] How to log in in both the React SPA and regular Django admin site?
See original GitHub issueSorry if I drop here a question but I did not found any other discussion group.
This is my use case: I have a private app consisting of a complex dashboard (React + Apollo Client) and a Django backend, and of course I’m using django-graphql-jwt. I’ve successfully set up authentication via cookie + CSRF token, it works like a charm.
Now I’m forced to go live before the dashboard is complete (guess what… 😞) so we decided to give the customer access the Django admin site, at least in the development period of the dashboard.
The main entry point of the app is the dashboard login so I’d like the user could to log in both the React SPA (it’s already working, as said) and the Django admin site: I have added a link to /admin
in the dashboard menu but in this moment the user is requested to log in again, which seems acceptable to me… but the customer has a different idea 😒
Any advice to save me?
Issue Analytics
- State:
- Created 3 years ago
- Comments:6
Top GitHub Comments
Yes the client has the old JWT. In my use case this is not a problem at all because:
/admin
is temporary and will be removed when the app will be completedIn any case it’s easy to extend the Django SessionMiddleware to delete the JWT.
And what about this situation: user has loged in from another user in admin-page. Client has old JWT?