25 lines
531 B
PHP
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();
|
|
}
|
|
}
|
|
|