mirror of
https://github.com/delight-im/PHP-Auth.git
synced 2025-08-27 09:34:45 +02:00
Accept masked SMS/email recipients in 'SecondFactorRequiredException'
This commit is contained in:
@@ -13,8 +13,10 @@ class SecondFactorRequiredException extends AuthException {
|
|||||||
|
|
||||||
protected $totp;
|
protected $totp;
|
||||||
protected $smsRecipient;
|
protected $smsRecipient;
|
||||||
|
protected $smsRecipientMasked;
|
||||||
protected $smsOtpValue;
|
protected $smsOtpValue;
|
||||||
protected $emailRecipient;
|
protected $emailRecipient;
|
||||||
|
protected $emailRecipientMasked;
|
||||||
protected $emailOtpValue;
|
protected $emailOtpValue;
|
||||||
|
|
||||||
public function hasTotpOption() {
|
public function hasTotpOption() {
|
||||||
@@ -29,6 +31,10 @@ class SecondFactorRequiredException extends AuthException {
|
|||||||
return $this->smsRecipient;
|
return $this->smsRecipient;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getSmsRecipientMasked() {
|
||||||
|
return $this->smsRecipientMasked;
|
||||||
|
}
|
||||||
|
|
||||||
public function getSmsOtpValue() {
|
public function getSmsOtpValue() {
|
||||||
return $this->smsOtpValue;
|
return $this->smsOtpValue;
|
||||||
}
|
}
|
||||||
@@ -41,6 +47,10 @@ class SecondFactorRequiredException extends AuthException {
|
|||||||
return $this->emailRecipient;
|
return $this->emailRecipient;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getEmailRecipientMasked() {
|
||||||
|
return $this->emailRecipientMasked;
|
||||||
|
}
|
||||||
|
|
||||||
public function getEmailOtpValue() {
|
public function getEmailOtpValue() {
|
||||||
return $this->emailOtpValue;
|
return $this->emailOtpValue;
|
||||||
}
|
}
|
||||||
@@ -49,14 +59,16 @@ class SecondFactorRequiredException extends AuthException {
|
|||||||
$this->totp = true;
|
$this->totp = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addSmsOption($otpValue, $recipient) {
|
public function addSmsOption($otpValue, $recipient, $recipientMasked = null) {
|
||||||
$this->smsOtpValue = !empty($otpValue) ? (string) $otpValue : null;
|
$this->smsOtpValue = !empty($otpValue) ? (string) $otpValue : null;
|
||||||
$this->smsRecipient = !empty($recipient) ? (string) $recipient : null;
|
$this->smsRecipient = !empty($recipient) ? (string) $recipient : null;
|
||||||
|
$this->smsRecipientMasked = !empty($recipientMasked) ? (string) $recipientMasked : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addEmailOption($otpValue, $recipient) {
|
public function addEmailOption($otpValue, $recipient, $recipientMasked = null) {
|
||||||
$this->emailOtpValue = !empty($otpValue) ? (string) $otpValue : null;
|
$this->emailOtpValue = !empty($otpValue) ? (string) $otpValue : null;
|
||||||
$this->emailRecipient = !empty($recipient) ? (string) $recipient : null;
|
$this->emailRecipient = !empty($recipient) ? (string) $recipient : null;
|
||||||
|
$this->emailRecipientMasked = !empty($recipientMasked) ? (string) $recipientMasked : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user