Thursday, March 30, 2017

[UNRESOLVED]Laravel Login always return false due to getAuthPassword return null

As per my title mentioned. I can't use auth()->attempt($credentials, false) as it always return false.
After further digging in to the problem, finally found that it was due to this.
public function validateCredentials(UserContract $user, array $credentials)
    {
        $plain = $credentials['password'];

        return $this->hasher->check($plain, $user->getAuthPassword());
    }

the $user->getAuthPassword() return null even though the $user have password on the original while I dump it out
Does anybody know how this getAuthPassword() work?


via AKZhang

Advertisement