diff --git a/src/SecondFactorRequiredException.php b/src/SecondFactorRequiredException.php new file mode 100644 index 0000000..4ed17e2 --- /dev/null +++ b/src/SecondFactorRequiredException.php @@ -0,0 +1,62 @@ +totp); + } + + public function hasSmsOption() { + return !empty($this->smsRecipient) && !empty($this->smsOtpValue); + } + + public function getSmsRecipient() { + return $this->smsRecipient; + } + + public function getSmsOtpValue() { + return $this->smsOtpValue; + } + + public function hasEmailOption() { + return !empty($this->emailRecipient) && !empty($this->emailOtpValue); + } + + public function getEmailRecipient() { + return $this->emailRecipient; + } + + public function getEmailOtpValue() { + return $this->emailOtpValue; + } + + public function addTotpOption() { + $this->totp = true; + } + + public function addSmsOption($recipient, $otpValue) { + $this->smsRecipient = !empty($recipient) ? (string) $recipient : null; + $this->smsOtpValue = !empty($otpValue) ? (string) $otpValue : null; + } + + public function addEmailOption($recipient, $otpValue) { + $this->emailRecipient = !empty($recipient) ? (string) $recipient : null; + $this->emailOtpValue = !empty($otpValue) ? (string) $otpValue : null; + } + +}