ft_transcendence/accounts/views/logout.py

15 lines
484 B
Python
Raw Normal View History

from django.shortcuts import render
from django.views import View
from django.http import HttpResponse, HttpRequest
from django.contrib.auth import logout
from django.utils.decorators import method_decorator
from django.contrib.auth.decorators import login_required
from ..status_code import *
class LogoutView(View):
@method_decorator(login_required, name='dispatch')
def get(self, request: HttpRequest):
logout(request)
return HttpResponse(USER_LOGOUT)