Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

BrunoHoinacki's avatar

Hello people!! FIX erro Jetstream + Liveware + tailwind + Socialite in laravel 11

for authenticate users with socialite is necessary setting the password to null: $table->string('password')->nullable();

But when do this show one erro for authenticate, need a password to validate the session in app/vendor/laravel/framework/src/Illuminate/Session/Middleware/AuthenticateSession.php:

if (! hash_equals($request->session()->get('password_hash_'.$this->auth->getDefaultDriver()), $request->user()->getAuthPassword())) { $this->logout($request); } }

fix this with:

if ($request->user() && $request->user()->password) { if (! hash_equals($request->session()->get('password_hash_'.$this->auth->getDefaultDriver()), $request->user()->getAuthPassword())) { $this->logout($request); } }

0 likes
1 reply
yvonne910rhodes's avatar

Hello,

It seems you’ve encountered a common issue when integrating Socialite with Laravel for social authentication, where users authenticated via social providers do not have a password. The error arises because Laravel’s session authentication middleware expects a password hash to verify the session.

Your proposed fix is on the right track. By adding a condition to check if the user has a password before comparing the session hash, you can prevent users without a password from being logged out. Here’s the adjusted code snippet for clarity:

if ($request->user() && $request->user()->password) { if (! hash_equals($request->session()->get('password_hash_'.$this->auth->getDefaultDriver()), $request->user()->getAuthPassword())) { $this->logout($request); } } This modification ensures that the password hash check is only performed if the user has a password set, which is not the case for users authenticated through social providers.

I hope the information may helps you.

Please or to participate in this conversation.