Relative Content

Tag Archive for authenticationdjango-allauthdjango-middlewaredjango-requestdjango-ninja

request.user.is_authenticated is returning False even though `X-Session-Token` header is sent in django-allauth (headless) {app}

I’m using django-allauth (headless, {app}) as my authentication backend along with django-ninja. I’ve set-up django-allauth configurations properly. If I login using POST http://127.0.0.1:8000/_allauth/app/v1/auth/login with a valid body (username & pass), it successfully responds with a session token. As instructed in the docs, when I set X-Session-Token header with this token value & send a request to http://localhost:8000/_allauth/app/v1/auth/session (Get authentication status), it also responds successfully with json body containing “meta”: {“is_authenticated”: true}, meaning the user is authenticated.