Google2Fa ready to upload
This commit is contained in:
parent
e3495be8b8
commit
73e38a006e
127 changed files with 2637 additions and 589 deletions
24
app/Http/Middleware/AuthGoogle2FA.php
Normal file
24
app/Http/Middleware/AuthGoogle2FA.php
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Auth;
|
||||
use Closure;
|
||||
use App\Services\AuthGoogle2FA;
|
||||
|
||||
class AuthGoogle2FA
|
||||
{
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue