mirror of
https://github.com/delight-im/PHP-Auth.git
synced 2025-08-03 22:57:27 +02:00
Swap order of arguments for 'addSmsOption' and 'addEmailOption'
This commit is contained in:
@@ -1321,10 +1321,10 @@ final class Auth extends UserManager {
|
||||
$otpValue = $this->generateAndStoreRandomOneTimePassword($userId, $twoFactorMethod['mechanism']);
|
||||
|
||||
if (((int) $twoFactorMethod['mechanism']) === self::TWO_FACTOR_MECHANISM_SMS) {
|
||||
$secondFactorRequiredException->addSmsOption($twoFactorMethod['seed'], $otpValue);
|
||||
$secondFactorRequiredException->addSmsOption($otpValue, $twoFactorMethod['seed']);
|
||||
}
|
||||
elseif (((int) $twoFactorMethod['mechanism']) === self::TWO_FACTOR_MECHANISM_EMAIL) {
|
||||
$secondFactorRequiredException->addEmailOption($twoFactorMethod['seed'], $otpValue);
|
||||
$secondFactorRequiredException->addEmailOption($otpValue, $twoFactorMethod['seed']);
|
||||
}
|
||||
else {
|
||||
throw new InvalidStateError();
|
||||
|
@@ -49,14 +49,14 @@ class SecondFactorRequiredException extends AuthException {
|
||||
$this->totp = true;
|
||||
}
|
||||
|
||||
public function addSmsOption($recipient, $otpValue) {
|
||||
$this->smsRecipient = !empty($recipient) ? (string) $recipient : null;
|
||||
public function addSmsOption($otpValue, $recipient) {
|
||||
$this->smsOtpValue = !empty($otpValue) ? (string) $otpValue : null;
|
||||
$this->smsRecipient = !empty($recipient) ? (string) $recipient : null;
|
||||
}
|
||||
|
||||
public function addEmailOption($recipient, $otpValue) {
|
||||
$this->emailRecipient = !empty($recipient) ? (string) $recipient : null;
|
||||
public function addEmailOption($otpValue, $recipient) {
|
||||
$this->emailOtpValue = !empty($otpValue) ? (string) $otpValue : null;
|
||||
$this->emailRecipient = !empty($recipient) ? (string) $recipient : null;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user