Redirect user to login page after logout

This commit is contained in:
PCoder 2019-02-24 20:15:52 +01:00
parent f61023d01a
commit 5903e10d87

View file

@ -441,7 +441,13 @@ class DeleteAccount(LoginRequiredMixin, View):
class LogOut(View):
def get(self, request):
logout(request)
return HttpResponse("You have been logged out.", status=200)
return HttpResponse(
"You have been logged out. You will be redirected in 2 seconds."
"<script>"
"setTimeout(function (){document.location.href='/';}, 2000);"
"</script>",
status=200
)