Support the ongoing development of Laravel.io →
Authentication Security Forms
Last updated 1 year ago.
0

Does Auth::attempt($user) return true?

0

kokokurak said:

Does Auth::attempt($user) return true?

Yes, in the login action it return true, but only in the loginAction. If I try something like this after loginAction (using correct username and password) :

Route::get('/users/index',function()
    {
        return bb($Auth:check())); // This wil return false (no user logged)
    })

0

I've sloved the issue by Adding

protected $primaryKey = 'user_id';

To my User model, because my primary key weren't 'id' so I had to change that

Last updated 9 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

chlebta chlebta Joined 20 Jan 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.