mirror of
https://github.com/Tivix/django-rest-auth.git
synced 2025-06-29 17:13:03 +03:00
Add the ability to set the path of the refresh cookie
This commit is contained in:
parent
802216567a
commit
5d6e8ca03b
|
@ -104,6 +104,7 @@ class LoginView(GenericAPIView):
|
||||||
if getattr(settings, 'REST_USE_JWT', False):
|
if getattr(settings, 'REST_USE_JWT', False):
|
||||||
cookie_name = getattr(settings, 'JWT_AUTH_COOKIE', None)
|
cookie_name = getattr(settings, 'JWT_AUTH_COOKIE', None)
|
||||||
refresh_cookie_name = getattr(settings, 'JWT_AUTH_REFRESH_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_secure = getattr(settings, 'JWT_AUTH_SECURE', False)
|
||||||
cookie_httponly = getattr(settings, 'JWT_AUTH_HTTPONLY', True)
|
cookie_httponly = getattr(settings, 'JWT_AUTH_HTTPONLY', True)
|
||||||
cookie_samesite = getattr(settings, 'JWT_AUTH_SAMESITE', 'Lax')
|
cookie_samesite = getattr(settings, 'JWT_AUTH_SAMESITE', 'Lax')
|
||||||
|
@ -125,7 +126,8 @@ class LoginView(GenericAPIView):
|
||||||
expires=refresh_token_expiration,
|
expires=refresh_token_expiration,
|
||||||
secure=cookie_secure,
|
secure=cookie_secure,
|
||||||
httponly=cookie_httponly,
|
httponly=cookie_httponly,
|
||||||
samesite=cookie_samesite
|
samesite=cookie_samesite,
|
||||||
|
path=refresh_cookie_path
|
||||||
)
|
)
|
||||||
return response
|
return response
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user