config->requestFix, $url); if(empty($account) || empty($token)) die('Invalid params. Please provide account, token and url.'); $user = $this->im->userIdentifyWithToken($account, $token, $device); if(!$user || is_string($user)) die('Invalid token.'); if(empty($url)) die('Authorized, but no url to redirect to.'); $user = $this->loadModel('user')->getByAccount($account); $user = $this->user->login($user); $url .= $this->config->requestType == 'GET' ? '&' : '?'; $url .= "{$this->config->sessionVar}={$this->app->sessionID}"; if ($this->config->requestType == 'GET') $url .= "&{$this->config->viewVar}=json"; else $url = str_replace('.html', '.json', $url); header("Location: $url", true, 307); } }