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,24 @@
<?php
namespace App\Http\Middleware;
use Auth;
use Closure;
use App\Services\AuthGoogle2FA;
class Google2FA
{
public function handle($request, Closure $next)
{
$AuthGoogle2FA = app(AuthGoogle2FA::class)->init($request);
if(!Auth::user()->isGoogle2Fa()){
return $AuthGoogle2FA->makeActiveOneTimePasswordResponse();
}
if ($AuthGoogle2FA->isAuthenticated()) {
return $next($request);
}
return $AuthGoogle2FA->makeRequestOneTimePasswordResponse();
}
}