laravel passport custom password column

走远了吗. 提交于 2019-12-01 06:54:44

There's a method the Passport/Bridge asks for called validateForPassportPasswordGrant($password) that you can override in your user model, if you don't override this it will look for a 'password' column in your user table. I'm not entirely sure why they haven't configured it to use Authenticatable method getAuthPassword...

Adding this validateForPassportPasswordGrant method to User model did the job for me ("PasswMd" - custom column name):

public function validateForPassportPasswordGrant($password)
{
    return Hash::check($password, $this->PasswMd);
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!