From 5d6e8ca03b555f2695221a245a5f82760aa5c03f Mon Sep 17 00:00:00 2001 From: Joel Whitaker Date: Thu, 29 Oct 2020 15:42:15 +0000 Subject: [PATCH] Add the ability to set the path of the refresh cookie --- dj_rest_auth/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dj_rest_auth/views.py b/dj_rest_auth/views.py index 4081fc9..c653c92 100644 --- a/dj_rest_auth/views.py +++ b/dj_rest_auth/views.py @@ -104,6 +104,7 @@ class LoginView(GenericAPIView): if getattr(settings, 'REST_USE_JWT', False): cookie_name = getattr(settings, 'JWT_AUTH_COOKIE', None) refresh_cookie_name = getattr(settings, 'JWT_AUTH_REFRESH_COOKIE', None) + refresh_cookie_path = getattr(settings, 'JWT_AUTH_REFRESH_COOKIE_PATH', '/') cookie_secure = getattr(settings, 'JWT_AUTH_SECURE', False) cookie_httponly = getattr(settings, 'JWT_AUTH_HTTPONLY', True) cookie_samesite = getattr(settings, 'JWT_AUTH_SAMESITE', 'Lax') @@ -125,7 +126,8 @@ class LoginView(GenericAPIView): expires=refresh_token_expiration, secure=cookie_secure, httponly=cookie_httponly, - samesite=cookie_samesite + samesite=cookie_samesite, + path=refresh_cookie_path ) return response