trf_certest/app/Http/Middleware/TwoFactorEnabled.php
2025-02-26 08:57:46 +01:00

25 lines
472 B
PHP

<?php
namespace Vanguard\Http\Middleware;
use Closure;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
class TwoFactorEnabled
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @return mixed
*/
public function handle($request, Closure $next)
{
if (! setting('2fa.enabled')) {
throw new NotFoundHttpException;
}
return $next($request);
}
}