2FAuth/app/Extensions/EloquentTwoFAuthProvider.php

32 lines
1008 B
PHP
Raw Normal View History

2022-03-15 14:47:07 +01:00
<?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');
}
}