Google2Fa ready to upload
This commit is contained in:
parent
e3495be8b8
commit
73e38a006e
127 changed files with 2637 additions and 589 deletions
25
app/Http/Middleware/Google2FAAuth.php
Normal file
25
app/Http/Middleware/Google2FAAuth.php
Normal 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();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue