护照核对为真,但无法得到任何回应

时间:2019-07-18 03:45:01

标签: php laravel laravel-passport

我使用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,
        ],

没有错误消息。

0 个答案:

没有答案