Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to remove the access token from the response payload? #589

Open
afoalb opened this issue Feb 5, 2024 · 0 comments
Open

How to remove the access token from the response payload? #589

afoalb opened this issue Feb 5, 2024 · 0 comments

Comments

@afoalb
Copy link

afoalb commented Feb 5, 2024

My REST_AUTH config

REST_AUTH = {
    'PASSWORD_RESET_USE_SITES_DOMAIN': False,
    'OLD_PASSWORD_FIELD_ENABLED': False,
    'LOGOUT_ON_PASSWORD_CHANGE': False,
    'SESSION_LOGIN': True,
    'USE_JWT': True,

    'JWT_AUTH_COOKIE': 'JWTAccess',
    'JWT_AUTH_REFRESH_COOKIE': 'JWTRefresh',
    'JWT_AUTH_REFRESH_COOKIE_PATH': '/',
    'JWT_AUTH_SECURE': False,
    'JWT_AUTH_HTTPONLY': True,
    'JWT_AUTH_SAMESITE': 'Lax',
    'JWT_AUTH_RETURN_EXPIRATION': False,
    'JWT_AUTH_COOKIE_USE_CSRF': False,
    'JWT_AUTH_COOKIE_ENFORCE_CSRF_ON_UNAUTHENTICATED': False,

}

Background

  1. I send the request: /dj-rest-auth/login/ (POST) with valid data.
  2. dj-rest-auth returns the following body in the response:
{
    "access": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVC3J9.eyJ0b2tlbl90eXBlIjoiYWNjZX3NzIiwiZXhwIjoxNzA3MTUxNTQzLCJpYXQiOjE3MDcxdE0ODMsImp0aSI6IjRkZDliYTVjYz4TQzOTY4NWJmZTQyODBiOd7E4NjZhIiwidXNlcl9pZCI6M30.HHpFrYegTtvyyVKcCaXG4jYWgAgDz1hWAEWx6rtqY4M",
    "refresh": "",
    "user": {
        "pk": 3,
        "email": "[email protected]",
        "first_name": "",
        "last_name": ""
    }
}

How can I make dj-rest-auth not return the access token in the response payload?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant