Skip to content

Commit

Permalink
Allow logout in middleware trap
Browse files Browse the repository at this point in the history
  • Loading branch information
MGlauer committed Oct 19, 2018
1 parent d9dd842 commit 0a6098e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions login/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ def process_request(self, request):
and not request.user.is_anonymous:

if not request.user.is_native:
if not request.path == DETACH_PATH:
if not (request.path == DETACH_PATH
or request.path.startswith('/logout')):
return HttpResponseRedirect(DETACH_PATH)
elif not request.user.is_mail_verified \
and not request.path.startswith(ACTIVATE_PATH):
and not (request.path.startswith(ACTIVATE_PATH)
or request.path.startswith('/logout')):
return HttpResponseRedirect(ACTIVATE_PATH)

0 comments on commit 0a6098e

Please sign in to comment.