from allauth.account.internal import flows
from allauth.account.utils import get_next_redirect_url
from django.shortcuts import redirect
from django.views import View


class LogoutView(View):

    def post(self, request):
        flows.logout.logout(request)
        url = get_next_redirect_url(request, "next") or "/"
        return redirect(url)
