feat: add WebAuthn multi-factor authentication (#2570)
This commit is contained in:
@@ -24,11 +24,13 @@ use Illuminate\Support\Facades\Auth;
|
||||
use App\Http\Requests\ImportsRequest;
|
||||
use App\Http\Requests\SettingsRequest;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use LaravelWebauthn\Models\WebauthnKey;
|
||||
use App\Http\Requests\InvitationRequest;
|
||||
use App\Services\Contact\Tag\DestroyTag;
|
||||
use App\Services\Account\DestroyAllDocuments;
|
||||
use PragmaRX\Google2FALaravel\Facade as Google2FA;
|
||||
use App\Http\Resources\Settings\U2fKey\U2fKey as U2fKeyResource;
|
||||
use App\Http\Resources\Settings\WebauthnKey\WebauthnKey as WebauthnKeyResource;
|
||||
|
||||
class SettingsController
|
||||
{
|
||||
@@ -72,6 +74,7 @@ class SettingsController
|
||||
'terms',
|
||||
'u2f_key',
|
||||
'users',
|
||||
'webauthn_keys',
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -528,9 +531,12 @@ class SettingsController
|
||||
$u2fKeys = U2fKey::where('user_id', auth()->id())
|
||||
->get();
|
||||
|
||||
$webauthnKeys = WebauthnKey::where('user_id', auth()->id())->get();
|
||||
|
||||
return view('settings.security.index')
|
||||
->with('is2FAActivated', Google2FA::isActivated())
|
||||
->with('currentkeys', U2fKeyResource::collection($u2fKeys));
|
||||
->with('currentkeys', U2fKeyResource::collection($u2fKeys))
|
||||
->withWebauthnKeys(WebauthnKeyResource::collection($webauthnKeys));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user