feat: menric
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Models\Admin;
|
||||
use BaconQrCode\Renderer\Image\SvgImageBackEnd;
|
||||
use BaconQrCode\Renderer\ImageRenderer;
|
||||
use BaconQrCode\Renderer\RendererStyle\RendererStyle;
|
||||
@@ -33,11 +32,11 @@ class AdminGoogle2fa
|
||||
return (bool) $this->google2fa->verifyKey($secret, $code);
|
||||
}
|
||||
|
||||
public function otpAuthUrl(Admin $admin, string $secret): string
|
||||
public function otpAuthUrl(string $username, string $secret, string $label = 'admin'): string
|
||||
{
|
||||
$issuer = (string) config('app.name', 'Coruna Lab');
|
||||
|
||||
return $this->google2fa->getQRCodeUrl($issuer, $admin->username.'@admin', $secret);
|
||||
return $this->google2fa->getQRCodeUrl($issuer, $username.'@'.$label, $secret);
|
||||
}
|
||||
|
||||
public function qrSvg(string $otpAuthUrl, int $size = 200): string
|
||||
|
||||
Reference in New Issue
Block a user