mirror of
https://github.com/Bubka/2FAuth.git
synced 2024-12-26 17:09:11 +01:00
32 lines
1008 B
PHP
32 lines
1008 B
PHP
|
<?php
|
||
|
|
||
|
namespace App\Extensions;
|
||
|
|
||
|
use DarkGhostHunter\Larapass\Auth\EloquentWebAuthnProvider;
|
||
|
use DarkGhostHunter\Larapass\WebAuthn\WebAuthnAssertValidator;
|
||
|
use Illuminate\Contracts\Config\Repository as ConfigContract;
|
||
|
use Illuminate\Contracts\Hashing\Hasher as HasherContract;
|
||
|
use Facades\App\Services\SettingService;
|
||
|
|
||
|
class EloquentTwoFAuthProvider extends EloquentWebAuthnProvider
|
||
|
{
|
||
|
/**
|
||
|
* Create a new database user provider.
|
||
|
*
|
||
|
* @param \Illuminate\Contracts\Config\Repository $config
|
||
|
* @param \DarkGhostHunter\Larapass\WebAuthn\WebAuthnAssertValidator $validator
|
||
|
* @param \Illuminate\Contracts\Hashing\Hasher $hasher
|
||
|
* @param string $model
|
||
|
*/
|
||
|
public function __construct(
|
||
|
ConfigContract $config,
|
||
|
WebAuthnAssertValidator $validator,
|
||
|
HasherContract $hasher,
|
||
|
string $model
|
||
|
) {
|
||
|
parent::__construct($config, $validator, $hasher, $model);
|
||
|
|
||
|
$this->fallback = !SettingService::get('useWebauthnOnly');
|
||
|
}
|
||
|
}
|