Skip to content

Commit

Permalink
fix for login bug with email link protection
Browse files Browse the repository at this point in the history
  • Loading branch information
bbonf committed Dec 12, 2024
1 parent da017a1 commit e8d55b0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lab/mailauth/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,11 @@ def try_authenticate(token: str) -> MailAuthResult:
# the parent app sets it via an api call
possible_pps = participants

mauth.session_token = token_urlsafe()
if mauth.session_token is None:
# link might be visited several times, and we don't want to invalidate a session
# (this causes issues with e.g. outlook link protection visiting the auth link for you)
mauth.session_token = token_urlsafe()

mauth.save()
return MailAuthResult(mauth=mauth, possible_pps=possible_pps, reason=MailAuthReason.SUCCESS)

Expand Down

0 comments on commit e8d55b0

Please sign in to comment.