Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

获取 refresh_token,access_token #43

Closed
hubs opened this issue Jun 18, 2015 · 2 comments
Closed

获取 refresh_token,access_token #43

hubs opened this issue Jun 18, 2015 · 2 comments
Milestone

Comments

@hubs
Copy link

hubs commented Jun 18, 2015

 public function user()
    {
        if ($this->authorizedUser
            || !$this->input->has('state')
            || (!$code = $this->input->get('code')) && $this->input->has('state')) {
            return $this->authorizedUser;
        }
        $permission = $this->getAccessPermission($code);
        if ($permission['scope'] !== 'snsapi_userinfo') {
            $user = new Bag(array('openid' => $permission['openid']));
        } else {
            $user = $this->getUser($permission['openid'], $permission['access_token']);
        }
        return $this->authorizedUser = $user;
    }

您好,当access_token过期时使用accessTokenIsValid时需要access_token和刷新使用refresh_token,而


$user = new Bag(array('openid' => $permission['openid']));

只返回了openid

@overtrue
Copy link
Collaborator

@hubs 谢谢,这块会在3.0里重构,目前的写法其实我也不满意

@overtrue overtrue added this to the 3.0 milestone Jun 18, 2015
@hubs
Copy link
Author

hubs commented Jun 19, 2015

哈哈,谢谢,等待你放大招

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants