Google2Fa ready to upload

This commit is contained in:
Kevin Adametz 2021-11-09 18:38:44 +01:00
parent e3495be8b8
commit 73e38a006e
127 changed files with 2637 additions and 589 deletions

View file

@ -0,0 +1,25 @@
<?php
namespace App\Http\Middleware;
use Closure;
use PragmaRX\Google2FALaravel\Support\Authenticator;
use Auth;
class Google2FA
{
public function handle($request, Closure $next)
{
$authenticator = app(Authenticator::class)->boot($request);
dd(Auth::user()->isGoogle2Fa());
if(Auth::user()->isGoogle2Fa()){
}
if ($authenticator->isAuthenticated()) {
return $next($request);
}
return $authenticator->makeRequestOneTimePasswordResponse();
}
}