public function makeLogin() { $access_token = $this->_sm_credentials->row['sc_token']; if ($access_token) { $this->_api->setAccessToken($access_token); } try { $this->_api->get('me'); } catch (Exception $e) { $authorize_url = $this->_api->getAuthorizeUrl(array('scope' => 'non-expiring')); $session = new Session('adm_session'); $session->set('referer', Header::getUri()); Header::redirect($authorize_url); } }
protected function getLoginUrl() { $session = new Session('adm_session'); $session->set('referer', Header::getUri()); Header::redirect($this->_youtube_client->createAuthUrl()); }