Skip to content

Commit

Permalink
fix(headless): Do not create an empty session in app context on logout
Browse files Browse the repository at this point in the history
  • Loading branch information
joonhyungshin authored and pennersr committed May 13, 2024
1 parent 8ae2a9e commit e2307ba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion allauth/headless/internal/authkit.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def authentication_context(request):
request.allauth.headless._pre_user.pk
yield
finally:
if request.session.modified:
if request.session.modified and not request.session.is_empty():
request.session.save()
request.user = old_user
request.session = old_session
Expand Down

0 comments on commit e2307ba

Please sign in to comment.