Repository: appsmithorg/appsmith
File: app/client/src/pages/UserAuth/Login.tsx (TypeScript)

Code before:
  }

  let forgotPasswordURL = `${FORGOT_PASSWORD_URL}`;

  if (props.emailValue && !isEmptyString(props.emailValue)) {
    forgotPasswordURL += `?email=${props.emailValue}`;
  }

  const footerSection = isFormLoginEnabled && (
    <div className="px-2 flex align-center justify-center text-center text-[color:var(--ads-v2\-color-fg)] text-[14px]">
      {createMessage(NEW_TO_APPSMITH)}&nbsp;
      <Link
        className="t--sign-up t--signup-link"
        kind="primary"
        target="_self"
        to={signupURL}
      >
        {createMessage(LOGIN_PAGE_SIGN_UP_LINK_TEXT)}
      </Link>
    </div>
  );

  return (
    <Container footer={footerSection} title={createMessage(LOGIN_PAGE_TITLE)}>
      <Helmet>
        <title>{htmlPageTitle}</title>
      </Helmet>

      {showError && (
        <Callout
          kind="error"
          links={
            !!errorMessage
              ? undefined
              : [
                  {
                    children: invalidCredsForgotPasswordLinkText,
                    to: FORGOT_PASSWORD_URL,
                  },
                ]
          }
        >
          {!!errorMessage && errorMessage !== "true"
            ? getSafeErrorMessage(errorMessage)
            : createMessage(LOGIN_PAGE_INVALID_CREDS_ERROR)}
        </Callout>
      )}
      {socialLoginList.length > 0 && (
        <ThirdPartyAuth logins={socialLoginList} type={"SIGNIN"} />
      )}
      {isFormLoginEnabled && (

Review comment (bug):
is this working as expected? I believe if the URL is `dev.appsmith.com`, we want to change it to `login.dev.appsmith.com`? While this I think will change it to `login.appsmith.com`.

Correct me if I'm wrong.

Code after:
  }

  let loginURL = "/api/v1/" + LOGIN_SUBMIT_PATH;
  let signupURL = SIGN_UP_URL;
  const redirectUrl = queryParams.get("redirectUrl");

  if (redirectUrl != null && getIsSafeRedirectURL(redirectUrl)) {
    const encodedRedirectUrl = encodeURIComponent(redirectUrl);

    loginURL += `?redirectUrl=${encodedRedirectUrl}`;
    signupURL += `?redirectUrl=${encodedRedirectUrl}`;
  }

  let forgotPasswordURL = `${FORGOT_PASSWORD_URL}`;

  if (props.emailValue && !isEmptyString(props.emailValue)) {
    forgotPasswordURL += `?email=${props.emailValue}`;
  }

  const getPrimaryLoginURL = () => {
    const hostnameParts = window.location.hostname.split(".");

    hostnameParts[0] = "login";
    const orgChangeURL = `https://${hostnameParts.join(".")}`;

    return orgChangeURL;
  };

  const multiOrgFooterContent = [
    {
      leftText: createMessage(MULTI_ORG_FOOTER_NOT_RIGHT_ORG_LEFT_TEXT),
      rightText: createMessage(MULTI_ORG_FOOTER_NOT_RIGHT_ORG_RIGHT_TEXT),
      rightTextLink: getPrimaryLoginURL() + "/org",
    },
    {
      leftText: createMessage(MULTI_ORG_FOOTER_NOT_PART_OF_ORG_LEFT_TEXT),
      rightText: createMessage(MULTI_ORG_FOOTER_NOT_PART_OF_ORG_RIGHT_TEXT),
      rightTextLink: getPrimaryLoginURL(),
    },
    {
      leftText: createMessage(MULTI_ORG_FOOTER_CREATE_ORG_LEFT_TEXT),
      rightText: createMessage(MULTI_ORG_FOOTER_CREATE_ORG_RIGHT_TEXT),
      rightTextLink: getPrimaryLoginURL(),
    },
  ];

  const footerSection = isFormLoginEnabled && (
    <div className="px-2 flex align-center justify-center text-center text-[color:var(--ads-v2\-color-fg)] text-[14px]">
      {createMessage(NEW_TO_APPSMITH)}&nbsp;
      <Link
        className="t--sign-up t--signup-link"