Skip to content

Commit

Permalink
fix(account/middleware): Don't purge stage on 404
Browse files Browse the repository at this point in the history
  • Loading branch information
pennersr committed Sep 18, 2023
1 parent eb96b35 commit 9f21675
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion allauth/account/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@ def process_exception(self, request, exception):
return exception.response

def _remove_dangling_login(self, request, response):
if request.path.startswith(settings.STATIC_URL):
if request.path.startswith(settings.STATIC_URL) or request.path in [
"/favicon.ico",
"/robots.txt",
"/humans.txt",
]:
return
if response.status_code // 100 != 2:
return
if not getattr(request, "_account_login_accessed", False):
if "account_login" in request.session:
Expand Down

0 comments on commit 9f21675

Please sign in to comment.