Phosphorum\Github\OAuth::authorize PHP Метод

authorize() публичный Метод

public authorize ( )
    public function authorize()
    {
        $this->view->disable();
        $params = ['client_id' => $this->clientId, 'redirect_uri' => $this->redirectUriAuthorize . urlencode('&statekey=' . $this->security->getTokenKey()), 'state' => $this->security->getToken(), 'scope' => 'user:email'];
        $url = $this->endPointAuthorize . '?' . http_build_query($params);
        $this->response->redirect($url, true);
    }

Usage Example

Пример #1
0
 /**
  * @return \Phalcon\Http\ResponseInterface|void
  */
 public function authorizeAction()
 {
     if (!$this->session->has('identity')) {
         $oauth = new OAuth($this->config->get('github', new Config()));
         return $oauth->authorize();
     }
     return $this->discussionsRedirect();
 }