Skip to content

Commit 0d63f63

Browse files
Josh Salwayclaude
andcommitted
Restore 204 response for login and logout endpoints
The fix from PR #1061 (076865d) returned 204 No Content from login() and logout() to signal navigation completion to WebDriver. This was present on 7.x but lost during the 8.x branch creation, causing intermittent loginAs() failures (#1152) and favicon 404s. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 6702453 commit 0d63f63

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/Http/Controllers/UserController.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function user($guard = null)
3333
*
3434
* @param string $userId
3535
* @param string|null $guard
36-
* @return void
36+
* @return \Illuminate\Http\Response
3737
*/
3838
public function login($userId, $guard = null)
3939
{
@@ -46,13 +46,15 @@ public function login($userId, $guard = null)
4646
: $provider->retrieveById($userId);
4747

4848
Auth::guard($guard)->login($user);
49+
50+
return response(status: 204);
4951
}
5052

5153
/**
5254
* Log the user out of the application.
5355
*
5456
* @param string|null $guard
55-
* @return void
57+
* @return \Illuminate\Http\Response
5658
*/
5759
public function logout($guard = null)
5860
{
@@ -61,6 +63,8 @@ public function logout($guard = null)
6163
Auth::guard($guard)->logout();
6264

6365
Session::forget('password_hash_'.$guard);
66+
67+
return response(status: 204);
6468
}
6569

6670
/**

0 commit comments

Comments
 (0)