1
0
mirror of https://github.com/delight-im/PHP-Auth.git synced 2025-08-02 14:17:26 +02:00

Capture 2FA configuration in variable before returning it

This commit is contained in:
Marco
2025-05-27 10:10:29 +02:00
parent cdcc82040f
commit 10cf5a3855

View File

@@ -1845,7 +1845,9 @@ final class Auth extends UserManager {
public function prepareTwoFactorViaTotp($serviceName = null) {
$serviceName = !empty($serviceName) ? (string) $serviceName : (!empty($_SERVER['SERVER_NAME']) ? (string) $_SERVER['SERVER_NAME'] : (string) $_SERVER['SERVER_ADDR']);
return $this->prepareTwoFactor(self::TWO_FACTOR_MECHANISM_TOTP, $serviceName, null);
$keyUriAndSecretString = $this->prepareTwoFactor(self::TWO_FACTOR_MECHANISM_TOTP, $serviceName, null);
return $keyUriAndSecretString;
}
/**
@@ -2033,7 +2035,9 @@ final class Auth extends UserManager {
* @throws AuthError if an internal problem occurred (do *not* catch)
*/
public function enableTwoFactorViaTotp($otpValue) {
return $this->enableTwoFactor(self::TWO_FACTOR_MECHANISM_TOTP, $otpValue);
$recoveryCodes = $this->enableTwoFactor(self::TWO_FACTOR_MECHANISM_TOTP, $otpValue);
return $recoveryCodes;
}
/**
@@ -2053,7 +2057,9 @@ final class Auth extends UserManager {
* @throws AuthError if an internal problem occurred (do *not* catch)
*/
public function enableTwoFactorViaSms($otpValue) {
return $this->enableTwoFactor(self::TWO_FACTOR_MECHANISM_SMS, $otpValue);
$recoveryCodes = $this->enableTwoFactor(self::TWO_FACTOR_MECHANISM_SMS, $otpValue);
return $recoveryCodes;
}
/**
@@ -2073,7 +2079,9 @@ final class Auth extends UserManager {
* @throws AuthError if an internal problem occurred (do *not* catch)
*/
public function enableTwoFactorViaEmail($otpValue) {
return $this->enableTwoFactor(self::TWO_FACTOR_MECHANISM_EMAIL, $otpValue);
$recoveryCodes = $this->enableTwoFactor(self::TWO_FACTOR_MECHANISM_EMAIL, $otpValue);
return $recoveryCodes;
}
/**