mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-06-24 14:02:09 +02:00
Render proxy authentication exception as 407 response
This commit is contained in:
parent
60787d9328
commit
9deb821d53
@ -59,5 +59,16 @@ class Handler extends ExceptionHandler
|
|||||||
return response()->json([
|
return response()->json([
|
||||||
'message' => $exception->getMessage()], 400);
|
'message' => $exception->getMessage()], 400);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$this->renderable(function (\Illuminate\Auth\AuthenticationException $exception, $request) {
|
||||||
|
if ($exception->guards() === ['reverse-proxy-guard']) {
|
||||||
|
return response()->json([
|
||||||
|
'message' => $exception->getMessage()], 407);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return response()->json([
|
||||||
|
'message' => $exception->getMessage()], $exception->getCode());
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user