Skip to content

Commit

Permalink
Use samesite config setting value (#436)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dresdn committed Jan 2, 2023
1 parent 4cab22e commit cccf816
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dj_rest_auth/jwt_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,12 @@ def unset_jwt_cookies(response):
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_samesite = getattr(settings, 'JWT_AUTH_SAMESITE', 'Lax')

if cookie_name:
response.delete_cookie(cookie_name, samesite=None)
response.delete_cookie(cookie_name, samesite=cookie_samesite)
if refresh_cookie_name:
response.delete_cookie(refresh_cookie_name, path=refresh_cookie_path, samesite=None)
response.delete_cookie(refresh_cookie_name, path=refresh_cookie_path, samesite=cookie_samesite)


class CookieTokenRefreshSerializer(TokenRefreshSerializer):
Expand Down

0 comments on commit cccf816

Please sign in to comment.