Skip to content

Commit

Permalink
Pass OTP Code to smsProvider() in SystemOtpProvider class
Browse files Browse the repository at this point in the history
  • Loading branch information
HasanAlyazidi committed Nov 2, 2023
1 parent 0102dd7 commit b64394a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/OTP/Providers/OurSMSOtpProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class OurSMSOtpProvider extends SystemOtpProvider
{
public function smsProvider(string $message) : ISMSProvider
public function smsProvider(string $message, string $code) : ISMSProvider
{
return new OurSMSProvider($message, $this->mobile);
}
Expand Down
2 changes: 1 addition & 1 deletion src/OTP/Providers/OurSMSV2OtpProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class OurSMSV2OtpProvider extends SystemOtpProvider
{
public function smsProvider(string $message) : ISMSProvider
public function smsProvider(string $message, string $code) : ISMSProvider
{
return new OurSMSV2Provider($message, $this->mobile);
}
Expand Down
4 changes: 2 additions & 2 deletions src/OTP/Providers/SystemOtpProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function __construct(string $mobile) {
$this->mobile = SendablesHelpers::removeLeadingPlus($mobile);
}

abstract public function smsProvider(string $message) : ISMSProvider;
abstract public function smsProvider(string $message, string $code) : ISMSProvider;

public function getClientType() : string
{
Expand All @@ -40,7 +40,7 @@ public function send() : bool

$message = __('sendables::otp.messages.code', ['code' => $code]);

$sms = $this->smsProvider($message);
$sms = $this->smsProvider($message, $code);
$sms->send();

DB::commit();
Expand Down

0 comments on commit b64394a

Please sign in to comment.