Merge pull request #7390 from diox/fix-logout-delete

Properly set the token cookie domain when deleting it
This commit is contained in:
Mathieu Pillard 2018-01-25 11:45:26 +01:00 коммит произвёл GitHub
Родитель 1237c45018 0850b4c071
Коммит 526aab5ebe
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 2 добавлений и 6 удалений

Просмотреть файл

@ -267,11 +267,6 @@ def add_api_token_to_response(response, user):
return response
def remove_api_token_cookie(response):
"""Delete the api token cookie."""
response.delete_cookie(API_TOKEN_COOKIE)
class FxAConfigMixin(object):
def get_config_name(self, request):
@ -330,7 +325,8 @@ class AuthenticateView(FxAConfigMixin, APIView):
def logout_user(request, response):
logout(request)
remove_api_token_cookie(response)
response.delete_cookie(
API_TOKEN_COOKIE, domain=settings.SESSION_COOKIE_DOMAIN)
class SessionView(APIView):