feat: HADO_DEV_USER substitutes X-Remote-User in local env

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BCrwHHnGCB5XH968Nxokqw
This commit is contained in:
2026-09-04 09:49:32 -03:00
parent cbb43714ae
commit edc08ff43e
5 changed files with 26 additions and 2 deletions

View File

@@ -18,6 +18,10 @@ class RemoteUser
public function handle(Request $request, Closure $next): Response
{
$login = trim((string) $request->header('X-Remote-User', ''));
if ($login === '' && app()->environment('local')) {
// Dev без хаба: HADO_DEV_USER подставляет пользователя. В проде не работает.
$login = trim((string) config('hado.dev_user'));
}
if ($login === '') {
return response()->json(['message' => 'Нет X-Remote-User: запрос должен идти через хаб'], 401);
}