feat: add WebAuthn multi-factor authentication (#2570)

This commit is contained in:
Alexis Saettler
2019-05-04 15:44:08 +02:00
committed by GitHub
parent aa75e7d3ce
commit ab15f93256
30 changed files with 2063 additions and 206 deletions
+7 -1
View File
@@ -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));
}
/**