Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
GraxMonzo committed Jan 18, 2021
2 parents 626c46b + 1e89102 commit af4a050
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/HasOTP.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

namespace GraxMonzo\OneTimePassword;

use Exception;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
use OTPHP\HOTP;

trait HasOTP
Expand Down Expand Up @@ -46,6 +44,7 @@ public function otp(): ?string
$hotp = HOTP::create($this->$otpSecret, 0, 'sha1', $digits);

$this->$otpCounter = $this->$otpCounter + 1;

return $hotp->at($this->$otpCounter);
}

Expand All @@ -62,6 +61,7 @@ public function verify(string $otp): ?bool

$otpStatus = $hotp->verify($otp, $this->$otpCounter);
$this->$otpCounter++;

return $otpStatus;
}
}

0 comments on commit af4a050

Please sign in to comment.