/** * @Route ("/auth/twitter") * @Transactional * * @param array $params * @param ViewModel $model * @throws Exception */ public function authTwitter(array $params, ViewModel $model) { try { $authHandler = new TwitterAuthHandler(); return $authHandler->authenticate($params, $model); } catch (\Exception $e) { $model->title = 'Login error'; $model->error = $e; return 'login'; } }
/** * @Route ("/auth/twitter") * * @param array $params * @param ViewModel $model * @return string * @throws Exception */ public function authTwitter(array $params, ViewModel $model) { try { $authHandler = new TwitterAuthHandler(); return $authHandler->authenticate($params); } catch (\Exception $e) { return $this->handleAuthError($e, $model); } }