iMerica / dj-rest-auth

Authentication for Django Rest Framework
https://dj-rest-auth.readthedocs.io/en/latest/index.html
MIT License
1.67k stars 311 forks source link

Unable to perform successive re-login. #407

Closed Leggendario12 closed 2 years ago

Leggendario12 commented 2 years ago

When trying to attempt to login the initial login attempt succeed but the next attempt failed show an invalid login detail from the response.

In able for me to make it work again, I need to clear the records from the django_session table from apps database and set REST_SESSION_LOGIN=False and this eliminates the error altogether, this also eliminates the session cookies in the response headers.

I need to enable REST_SESSION_LOGIN = True as I am using it for the important backend processes.

Thanks a lot!

Leggendario12 commented 2 years ago

I solved the issue with disabling the rest_framework.authentication.SessionAuthentication by explicitly setting the authentication_classes on the package that requires it. It allows the use of SessionAuthentication without interfering with authentication using the API backend of dj_rest_auth.