langflow-ai / langflow

⛓️ Langflow is a visual framework for building multi-agent and RAG applications. It's open-source, Python-powered, fully customizable, model and vector store agnostic.

Home Page:http://www.langflow.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Langflow Store Suspension

YamonBot opened this issue · comments

image

I have been active in the Langflow Store using the account battlecruser@yamon.io.

However, I am unable to access it as the following error appears, and the API of the store I used to operate is not functioning.

To resolve the "User suspended" error and regain access to your Langflow Store account and API, you should follow these steps:

  1. Check Error Count and Logout: The system automatically logs out the user if the authentication error count exceeds 3. Ensure that you are not repeatedly failing to authenticate, as this will trigger the logout mechanism.

  2. Renew Access Token: The code includes a function tryToRenewAccessToken that attempts to renew the access token. This function is called when a 401 or 403 error is encountered. Ensure that your access token is being renewed correctly.

  3. Login Again: If the access token renewal fails, the system logs out the user. You will need to log in again to reset the authentication state.

Here is the relevant part of the code that handles these steps:

function checkErrorCount() {
  authenticationErrorCount = authenticationErrorCount + 1;

  if (authenticationErrorCount > 3) {
    authenticationErrorCount = 0;
    logout();
    return false;
  }

  return true;
}

async function tryToRenewAccessToken(error: AxiosError) {
  try {
    if (window.location.pathname.includes("/login")) return;
    const res = await renewAccessToken();
    if (res?.data?.access_token && res?.data?.refresh_token) {
      login(res?.data?.access_token);
    }
    if (error?.config?.headers) {
      delete error.config.headers["Authorization"];
      error.config.headers["Authorization"] = `Bearer ${cookies.get(
        "access_token_lf"
      )}`;
      const response = await axios.request(error.config);
      return response;
    }
  } catch (error) {
    clearBuildVerticesState(error);
    logout();
    return Promise.reject("Authentication error");
  }
}

To summarize:

  • Ensure you are not repeatedly failing to authenticate.
  • Allow the system to renew your access token.
  • If the token renewal fails, log in again to reset your authentication state [1].

To continue talking to Dosu, mention @dosu.