/** * @return \Phalcon\Http\Response|\Phalcon\Http\ResponseInterface */ public function tokenGoogleAction() { $this->view->disable(); $auth = new GoogleAuth($this->config->google); list($uid, $token, $user) = $auth->authorize(); if (isset($token) && is_object($token) && isset($uid)) { //Edit/Create the user $object = Users::findFirstByUuidGoogle($uid); $this->commonOauthSave($uid, $user, $token, $object, 'Google'); } else { $this->flashSession->error('Invalid Google response. Please try again'); return $this->response->redirect(); } }