public function redirect($url, $status = 302)
 {
     switch ($url) {
         case 'account/account':
             // Success
             // Get account data
             $this->response->setInterceptOutput(false);
             $this->request->server['REQUEST_METHOD'] = 'GET';
             $action = new ApiAction('account/account');
             $action->execute($this->registry);
             $this->response->setHttpResponseCode(ApiResponse::HTTP_RESPONSE_CODE_OK);
             $this->response->output();
             exit;
             break;
     }
 }
 public function redirect($url, $status = 302)
 {
     switch ($url) {
         case 'account/account':
             // Customer is already logged in
             throw new ApiException(ApiResponse::HTTP_RESPONSE_CODE_BAD_REQUEST, ErrorCodes::ERRORCODE_USER_ALREADY_LOGGED_IN, ErrorCodes::getMessage(ErrorCodes::ERRORCODE_USER_ALREADY_LOGGED_IN));
             break;
         case 'account/success':
             // Success
             // Get account data
             $this->response->setInterceptOutput(false);
             $this->request->post = array();
             $this->request->server['REQUEST_METHOD'] = 'GET';
             $action = new ApiAction('account/account');
             $action->execute($this->registry);
             $this->response->setHttpResponseCode(ApiResponse::HTTP_RESPONSE_CODE_CREATED);
             $this->response->output();
             exit;
             break;
     }
 }