mein-sterntours/app/Http/Middleware/Google2FAAuth.php
2021-11-09 18:38:44 +01:00

25 lines
531 B
PHP

<?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();
}
}