In order to unify package names, we decided to use `@appsmith` prefix as a marker to indicate that packages belong to our codebase and that these packages are developed internally. So that we can use this prefix, we need to rename the alias of the same name. But since `@appsmith` is currently being used as an alias for `ee` folder, we have to rename the alias as the first step. Related discussion https://theappsmith.slack.com/archives/CPG2ZTXEY/p1722516279126329 EE PR — https://github.com/appsmithorg/appsmith-ee/pull/4801 ## Automation /ok-to-test tags="@tag.All" ### 🔍 Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/10267368821> > Commit: 2b00af2d257e4d4304db0a80072afef7513de6be > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10267368821&attempt=2" target="_blank">Cypress dashboard</a>. > Tags: `@tag.All` > Spec: > <hr>Tue, 06 Aug 2024 14:24:22 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No
82 lines
3.0 KiB
TypeScript
82 lines
3.0 KiB
TypeScript
import React from "react";
|
|
import { Route, Switch, useLocation, useRouteMatch } from "react-router-dom";
|
|
import Login from "pages/UserAuth/Login";
|
|
import SignUp from "pages/UserAuth/SignUp";
|
|
import ForgotPassword from "./ForgotPassword";
|
|
import ResetPassword from "./ResetPassword";
|
|
import PageNotFound from "pages/common/ErrorPages/PageNotFound";
|
|
import * as Sentry from "@sentry/react";
|
|
import { requiresUnauth } from "./requiresAuthHOC";
|
|
import { useSelector } from "react-redux";
|
|
import { getThemeDetails, ThemeMode } from "selectors/themeSelectors";
|
|
import type { AppState } from "ee/reducers";
|
|
import { ThemeProvider } from "styled-components";
|
|
import VerificationPending from "./VerificationPending";
|
|
import VerifyUser from "./VerifyUser";
|
|
import VerificationError from "./VerificationError";
|
|
import FooterLinks from "./FooterLinks";
|
|
import { useIsMobileDevice } from "utils/hooks/useDeviceDetect";
|
|
import { getAssetUrl } from "ee/utils/airgapHelpers";
|
|
import { getTenantConfig } from "ee/selectors/tenantSelectors";
|
|
import { getAppsmithConfigs } from "ee/configs";
|
|
|
|
const SentryRoute = Sentry.withSentryRouting(Route);
|
|
|
|
export function UserAuth() {
|
|
const { path } = useRouteMatch();
|
|
const location = useLocation();
|
|
const lightTheme = useSelector((state: AppState) =>
|
|
getThemeDetails(state, ThemeMode.LIGHT),
|
|
);
|
|
const isMobileDevice = useIsMobileDevice();
|
|
const tenantConfig = useSelector(getTenantConfig);
|
|
const { cloudHosting } = getAppsmithConfigs();
|
|
|
|
return (
|
|
<ThemeProvider theme={lightTheme}>
|
|
{/* TODO: (Albin) - chnages this to ads-v2 variable once branding is sorted out. */}
|
|
<div
|
|
className={`absolute inset-0 flex flex-col overflow-y-auto auth-container bg-[color:var(--ads-color-background-secondary)] ${
|
|
!isMobileDevice ? "p-4" : "px-6 py-12"
|
|
} t--auth-container justify-between`}
|
|
>
|
|
{isMobileDevice && (
|
|
<img
|
|
className="h-8 mx-auto"
|
|
src={getAssetUrl(tenantConfig.brandLogoUrl)}
|
|
/>
|
|
)}
|
|
<Switch location={location}>
|
|
<SentryRoute component={Login} exact path={`${path}/login`} />
|
|
<SentryRoute component={SignUp} exact path={`${path}/signup`} />
|
|
<SentryRoute
|
|
component={ResetPassword}
|
|
exact
|
|
path={`${path}/resetPassword`}
|
|
/>
|
|
<SentryRoute
|
|
component={ForgotPassword}
|
|
exact
|
|
path={`${path}/forgotPassword`}
|
|
/>
|
|
<SentryRoute
|
|
component={VerificationPending}
|
|
exact
|
|
path={`${path}/verificationPending`}
|
|
/>
|
|
<SentryRoute component={VerifyUser} exact path={`${path}/verify`} />
|
|
<SentryRoute
|
|
component={VerificationError}
|
|
exact
|
|
path={`${path}/verify-error`}
|
|
/>
|
|
<SentryRoute component={PageNotFound} />
|
|
</Switch>
|
|
{cloudHosting && <FooterLinks />}
|
|
</div>
|
|
</ThemeProvider>
|
|
);
|
|
}
|
|
|
|
export default requiresUnauth(UserAuth);
|