yogibook-aury/app/Http/Middleware/TwoFactorEnabled.php
2024-09-18 16:47:42 +02:00

26 lines
503 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
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
if (! setting('2fa.enabled')) {
throw new NotFoundHttpException;
}
return $next($request);
}
}