This commit makes sure that the test URL is renamed to the general login URL for local development and only works in local development.

This commit is contained in:
2026-03-19 14:24:48 +01:00
parent 88895872c4
commit 17db4962c4
2 changed files with 9 additions and 7 deletions

View File

@@ -35,11 +35,13 @@
}); });
}); });
// Dev auto-login route // Dev auto-login route (local and testing environments only)
Route::get('/login-for-testing', function () { if (app()->environment(['local', 'testing'])) {
Route::get('/login-jonathan', function () {
$user = \App\Models\User::where('username', 'jonathan.van.rij@agerion.nl')->first(); $user = \App\Models\User::where('username', 'jonathan.van.rij@agerion.nl')->first();
auth()->login($user); auth()->login($user);
return redirect('/'); return redirect('/');
}); });
}

View File

@@ -98,7 +98,7 @@ public function test_login_jonathan_works_in_testing_env(): void
'updated_at' => now(), 'updated_at' => now(),
]); ]);
$this->get('/login-for-testing') $this->get('/login-jonathan')
->assertRedirect('/'); ->assertRedirect('/');
$user = User::where('username', 'jonathan.van.rij@agerion.nl')->first(); $user = User::where('username', 'jonathan.van.rij@agerion.nl')->first();