mirror of
https://github.com/delight-im/PHP-Auth.git
synced 2025-08-04 15:17:28 +02:00
Implement method 'Auth#isWaitingForSecondFactor'
This commit is contained in:
@@ -2192,6 +2192,15 @@ final class Auth extends UserManager {
|
|||||||
return $this->ipAddress;
|
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)
|
* Performs throttling or rate limiting using the token bucket algorithm (inverse leaky bucket algorithm)
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user