mirror of
https://github.com/Bubka/2FAuth.git
synced 2024-12-01 20:54:03 +01:00
29 lines
635 B
PHP
29 lines
635 B
PHP
<?php
|
|
|
|
namespace App\Http\Middleware;
|
|
|
|
use Closure;
|
|
use Illuminate\Support\Facades\Log;
|
|
|
|
class RejectIfReverseProxy
|
|
{
|
|
/**
|
|
* Handle an incoming request.
|
|
*
|
|
* @param \Illuminate\Http\Request $request
|
|
* @return mixed
|
|
*/
|
|
public function handle($request, Closure $next)
|
|
{
|
|
if (config('auth.defaults.guard') === 'reverse-proxy-guard') {
|
|
Log::info('Cannot request this action in reverse proxy mode');
|
|
|
|
return response()->json([
|
|
'message' => __('errors.unsupported_with_reverseproxy'),
|
|
], 405);
|
|
}
|
|
|
|
return $next($request);
|
|
}
|
|
}
|