diff --git a/src/Auth.php b/src/Auth.php index 7df6e5e..53effd1 100644 --- a/src/Auth.php +++ b/src/Auth.php @@ -2192,6 +2192,15 @@ final class Auth extends UserManager { return $this->ipAddress; } + /** + * Returns whether we are waiting for the user to complete the second factor of (two-factor) authentification, them having successfully completed the first factor before + * + * @return bool + */ + public function isWaitingForSecondFactor() { + return !empty($_SESSION[self::SESSION_FIELD_AWAITING_2FA_UNTIL]) && $_SESSION[self::SESSION_FIELD_AWAITING_2FA_UNTIL] >= \time(); + } + /** * Performs throttling or rate limiting using the token bucket algorithm (inverse leaky bucket algorithm) *