Ejemplo n.º 1
0
 /**
  * Get authorization code from callback and fetch user access_token and other information
  *
  * @access  public
  * @param   string      $provider
  * @return  Response
  * @throws  Auth_Strategy_Exception
  */
 public function action_callback($provider = null)
 {
     // if provider data is somehow empty, it might not came from a provider.
     if (empty($provider)) {
         throw new HttpNotFoundException();
     }
     try {
         $strategy = Auth_Strategy::make($provider);
         Auth_Strategy::login_or_register($strategy);
     } catch (Auth_Strategy_Exception $e) {
         return $this->action_error($provider, $e->getMessage());
     }
 }