I'm stumped, I have a programmatic login, Auth::login($user), that has worked in the past. Now when I hit that line, I get a 500 error back with no body content and strangely:
- there are no errors in the laravel log
- there are no errors in the PHP log
- there are no errors in the NGINX log
- there are no errors in the network tab, other than 500 error
What else could it be or how can I figure out what is causing this error?
For context, I'm using Laravel Herd locally, but this is also happening in Vapor. I'm using Intertia with Precognition. On PHP 8.3. Logins to FilamentPHP, the admin for the app, work fine, it's just this programmatic login.
Here is the truncated code where this is happening:
public function store(FindAccountToLoginRequest $request)
{
// I have some logic here to find the user to login
// it's working fine, I can dd($user) and see a valid user
$user = someLogicToDetermineUserToLogin();
// at this point, we have verified the user, so log them in
if ($user != null) {
Auth::login($user); // <- here is where the 500 error is thrown!
return Redirect::route('accounts.index');
}
}