3
0
Fork 0

Initial commit

This commit is contained in:
BuildTools 2020-02-26 14:59:58 +01:00
commit b105bd7db7
171 changed files with 28322 additions and 0 deletions

View file

@ -0,0 +1,27 @@
<?php
namespace App\Http\Middleware;
use Closure;
use PragmaRX\Google2FALaravel\Support\Authenticator;
class TwoFactorAuthentication
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
$authenticator = app(Authenticator::class)->boot($request);
if ($authenticator->isAuthenticated()) {
return $next($request);
}
return redirect()->route('2fa.authenticate');
}
}