Skip to content
This repository was archived by the owner on Sep 3, 2025. It is now read-only.

Commit 051e7c5

Browse files
authored
Check if challenge is already approved before raising exception (#5445)
1 parent f878a3e commit 051e7c5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/dispatch/plugins/dispatch_core/plugin.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,9 @@ def validate_mfa_token(
379379
raise ActionMismatchError("Action mismatch")
380380
if not challenge.valid:
381381
raise ExpiredChallengeError("Challenge is no longer valid")
382+
if challenge.status == MfaChallengeStatus.APPROVED:
383+
# Challenge has already been approved
384+
return challenge.status
382385
if challenge.status != MfaChallengeStatus.PENDING:
383386
raise InvalidChallengeStateError(f"Challenge is in invalid state: {challenge.status}")
384387

0 commit comments

Comments
 (0)