我使用laravel-passport获取令牌(/ oauth / token),模式为密码,通过验证,并在记录中存储了oauth_access_tokens,但是邮递员没有收到任何响应。
/**
* @param $username
* @return Model|\Illuminate\Database\Query\Builder|object|null
*/
public function findForPassport($username) {
$user_info = $this
->select([
'password',
'no'
])
->where('email', $username)
->first();
return $user_info;
}
/**
* @param $password
* @return bool
*/
public function validateForPassportPasswordGrant($password)
{
return $this->attributes['password'] == md5($password . md5( $this->attributes['no']));
}
'api' => [
'driver' => 'passport',
'provider' => 'accounts',
],
'accounts' => [
'driver' => 'eloquent',
'model' => App\Entities\User::class,
],
没有错误消息。