Commit f4b12e33 authored by Floréal Cabanettes's avatar Floréal Cabanettes

Fix logout with wsgi

parent 7befbd06
from django.views.generic import View
from django.contrib.auth import logout
from django.shortcuts import redirect
from django.middleware import csrf
class LogoutView(View):
def get(self, request):
if request.META["HTTP_REFERER"].find("/panel/") > -1 or request.META["HTTP_REFERER"].find("/admin/") > -1 or \
request.META["HTTP_REFERER"].find("/api/") > -1:
return redirect("/")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment