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:
@@ -52,6 +52,21 @@ class MeApiTest extends TestCase
|
||||
public function test_requires_remote_user_header(): void
|
||||
{
|
||||
$this->getJson('/me')->assertStatus(401);
|
||||
|
||||
// dev_user срабатывает только в local
|
||||
config(['hado.dev_user' => 'dev']);
|
||||
$this->getJson('/me')->assertStatus(401);
|
||||
}
|
||||
|
||||
public function test_dev_user_substitutes_header_in_local_env_only(): void
|
||||
{
|
||||
config(['hado.dev_user' => 'dev']);
|
||||
$this->app->detectEnvironment(fn () => 'local');
|
||||
|
||||
$this->getJson('/me')->assertOk()->assertJsonPath('login', 'dev');
|
||||
|
||||
config(['hado.dev_user' => '']);
|
||||
$this->getJson('/me')->assertStatus(401);
|
||||
}
|
||||
|
||||
public function test_first_visit_creates_user_with_web_channel(): void
|
||||
|
||||
Reference in New Issue
Block a user