I am making an API for an existing database. I noticed the problem first when I saw that Auth::attempt always returned false. Since I have implemented my own SHA1 hashing provider I thought that might be the problem.
But I tried Hash::make('test') and it gave me 'a94a8fe5ccb19ba61c4c0873d391e987982fbbd3'. Then I tried Hash::make($client->pwd) and it gave me the same hash. Correct so far. Finally I did
if (Hash::check('test', $cli->pwd))
{
[...]
}
and it returned false. From the looks of it the problem isn't my hashing provider and I guess this is also why Auth::attempt is failing. Can anyone tell me why ?
The problem was on my end. I misunderstood the concept of Eloquent. I had to change in my UserInterface class, the one my user model mapped to, getAuthIdentifier() to return "id" which is the PrimaryKey of my table. I though the getAuthIdentifier() was the "username" of the table.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments