Skip to content

Commit 076865d

Browse files
authored
Fix favicon 404s triggered when using loginAs() or logout() methods (#1061)
* return 204 no content * docblocks
1 parent 675e336 commit 076865d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Http/Controllers/UserController.php

+6-2
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)