-
-
- {twoFactorRequired &&
}
+ {twoFactorRequired &&
}
- {errorMessage &&
}
-
-
-
{!twoFactorRequired && (
<>
- {isGoogleLoginEnabled && (
-
+ {(isGoogleLoginEnabled || isSAMLLoginEnabled) &&
}
+
+ {isGoogleLoginEnabled && (
{
e.preventDefault();
// track Google logins. Without personal data/payload
@@ -187,17 +183,17 @@ export default function Login({
}}>
{t("signin_with_google")}
-
- )}
- {isSAMLLoginEnabled && (
-
- )}
+ )}
+ {isSAMLLoginEnabled && (
+
+ )}
+
>
)}
diff --git a/apps/web/pages/v2/availability/[schedule].tsx b/apps/web/pages/availability/[schedule].tsx
similarity index 100%
rename from apps/web/pages/v2/availability/[schedule].tsx
rename to apps/web/pages/availability/[schedule].tsx
diff --git a/apps/web/pages/v2/availability/index.tsx b/apps/web/pages/availability/index.tsx
similarity index 100%
rename from apps/web/pages/v2/availability/index.tsx
rename to apps/web/pages/availability/index.tsx
diff --git a/apps/web/pages/v2/availability/troubleshoot.tsx b/apps/web/pages/availability/troubleshoot.tsx
similarity index 100%
rename from apps/web/pages/v2/availability/troubleshoot.tsx
rename to apps/web/pages/availability/troubleshoot.tsx
diff --git a/apps/web/pages/v2/bookings/[status].tsx b/apps/web/pages/bookings/[status].tsx
similarity index 100%
rename from apps/web/pages/v2/bookings/[status].tsx
rename to apps/web/pages/bookings/[status].tsx
diff --git a/apps/web/pages/v2/event-types/[type]/index.tsx b/apps/web/pages/event-types/[type]/index.tsx
similarity index 100%
rename from apps/web/pages/v2/event-types/[type]/index.tsx
rename to apps/web/pages/event-types/[type]/index.tsx
diff --git a/apps/web/pages/v2/event-types/index.tsx b/apps/web/pages/event-types/index.tsx
similarity index 100%
rename from apps/web/pages/v2/event-types/index.tsx
rename to apps/web/pages/event-types/index.tsx
diff --git a/apps/web/pages/v2/settings/admin/apps.tsx b/apps/web/pages/settings/admin/apps.tsx
similarity index 100%
rename from apps/web/pages/v2/settings/admin/apps.tsx
rename to apps/web/pages/settings/admin/apps.tsx
diff --git a/apps/web/pages/v2/settings/admin/impersonation.tsx b/apps/web/pages/settings/admin/impersonation.tsx
similarity index 100%
rename from apps/web/pages/v2/settings/admin/impersonation.tsx
rename to apps/web/pages/settings/admin/impersonation.tsx
diff --git a/apps/web/pages/v2/settings/admin/index.tsx b/apps/web/pages/settings/admin/index.tsx
similarity index 100%
rename from apps/web/pages/v2/settings/admin/index.tsx
rename to apps/web/pages/settings/admin/index.tsx
diff --git a/apps/web/pages/v2/settings/admin/users.tsx b/apps/web/pages/settings/admin/users.tsx
similarity index 100%
rename from apps/web/pages/v2/settings/admin/users.tsx
rename to apps/web/pages/settings/admin/users.tsx
diff --git a/apps/web/pages/v2/settings/billing/index.tsx b/apps/web/pages/settings/billing/index.tsx
similarity index 100%
rename from apps/web/pages/v2/settings/billing/index.tsx
rename to apps/web/pages/settings/billing/index.tsx
diff --git a/apps/web/pages/v2/settings/developer/api-keys.tsx b/apps/web/pages/settings/developer/api-keys.tsx
similarity index 100%
rename from apps/web/pages/v2/settings/developer/api-keys.tsx
rename to apps/web/pages/settings/developer/api-keys.tsx
diff --git a/apps/web/pages/v2/settings/developer/webhooks/[id]/index.tsx b/apps/web/pages/settings/developer/webhooks/[id]/index.tsx
similarity index 100%
rename from apps/web/pages/v2/settings/developer/webhooks/[id]/index.tsx
rename to apps/web/pages/settings/developer/webhooks/[id]/index.tsx
diff --git a/apps/web/pages/v2/settings/developer/webhooks/index.tsx b/apps/web/pages/settings/developer/webhooks/index.tsx
similarity index 100%
rename from apps/web/pages/v2/settings/developer/webhooks/index.tsx
rename to apps/web/pages/settings/developer/webhooks/index.tsx
diff --git a/apps/web/pages/v2/settings/developer/webhooks/new.tsx b/apps/web/pages/settings/developer/webhooks/new.tsx
similarity index 100%
rename from apps/web/pages/v2/settings/developer/webhooks/new.tsx
rename to apps/web/pages/settings/developer/webhooks/new.tsx
diff --git a/apps/web/pages/v2/settings/my-account/appearance.tsx b/apps/web/pages/settings/my-account/appearance.tsx
similarity index 100%
rename from apps/web/pages/v2/settings/my-account/appearance.tsx
rename to apps/web/pages/settings/my-account/appearance.tsx
diff --git a/apps/web/pages/v2/settings/my-account/calendars.tsx b/apps/web/pages/settings/my-account/calendars.tsx
similarity index 100%
rename from apps/web/pages/v2/settings/my-account/calendars.tsx
rename to apps/web/pages/settings/my-account/calendars.tsx
diff --git a/apps/web/pages/v2/settings/my-account/conferencing.tsx b/apps/web/pages/settings/my-account/conferencing.tsx
similarity index 100%
rename from apps/web/pages/v2/settings/my-account/conferencing.tsx
rename to apps/web/pages/settings/my-account/conferencing.tsx
diff --git a/apps/web/pages/v2/settings/my-account/general.tsx b/apps/web/pages/settings/my-account/general.tsx
similarity index 100%
rename from apps/web/pages/v2/settings/my-account/general.tsx
rename to apps/web/pages/settings/my-account/general.tsx
diff --git a/apps/web/pages/v2/settings/my-account/profile.tsx b/apps/web/pages/settings/my-account/profile.tsx
similarity index 100%
rename from apps/web/pages/v2/settings/my-account/profile.tsx
rename to apps/web/pages/settings/my-account/profile.tsx
diff --git a/apps/web/pages/v2/settings/security/password.tsx b/apps/web/pages/settings/security/password.tsx
similarity index 100%
rename from apps/web/pages/v2/settings/security/password.tsx
rename to apps/web/pages/settings/security/password.tsx
diff --git a/apps/web/pages/v2/settings/security/two-factor-auth.tsx b/apps/web/pages/settings/security/two-factor-auth.tsx
similarity index 100%
rename from apps/web/pages/v2/settings/security/two-factor-auth.tsx
rename to apps/web/pages/settings/security/two-factor-auth.tsx
diff --git a/apps/web/pages/v2/settings/teams/[id]/appearance.tsx b/apps/web/pages/settings/teams/[id]/appearance.tsx
similarity index 100%
rename from apps/web/pages/v2/settings/teams/[id]/appearance.tsx
rename to apps/web/pages/settings/teams/[id]/appearance.tsx
diff --git a/apps/web/pages/v2/settings/teams/[id]/members.tsx b/apps/web/pages/settings/teams/[id]/members.tsx
similarity index 100%
rename from apps/web/pages/v2/settings/teams/[id]/members.tsx
rename to apps/web/pages/settings/teams/[id]/members.tsx
diff --git a/apps/web/pages/v2/settings/teams/[id]/profile.tsx b/apps/web/pages/settings/teams/[id]/profile.tsx
similarity index 100%
rename from apps/web/pages/v2/settings/teams/[id]/profile.tsx
rename to apps/web/pages/settings/teams/[id]/profile.tsx
diff --git a/apps/web/pages/v2/settings/teams/new/[[...step]].tsx b/apps/web/pages/settings/teams/new/[[...step]].tsx
similarity index 100%
rename from apps/web/pages/v2/settings/teams/new/[[...step]].tsx
rename to apps/web/pages/settings/teams/new/[[...step]].tsx
diff --git a/apps/web/pages/v2/success.tsx b/apps/web/pages/success.tsx
similarity index 100%
rename from apps/web/pages/v2/success.tsx
rename to apps/web/pages/success.tsx
diff --git a/apps/web/pages/v2/teams/index.tsx b/apps/web/pages/teams/index.tsx
similarity index 100%
rename from apps/web/pages/v2/teams/index.tsx
rename to apps/web/pages/teams/index.tsx
diff --git a/apps/web/pages/v2/apps/[slug]/index.tsx b/apps/web/pages/v2/apps/[slug]/index.tsx
deleted file mode 100644
index 2b69e599a4..0000000000
--- a/apps/web/pages/v2/apps/[slug]/index.tsx
+++ /dev/null
@@ -1,107 +0,0 @@
-import fs from "fs";
-import matter from "gray-matter";
-import { GetStaticPaths, GetStaticPropsContext } from "next";
-import { MDXRemote } from "next-mdx-remote";
-import { serialize } from "next-mdx-remote/serialize";
-import Image from "next/image";
-import Link from "next/link";
-import path from "path";
-
-import { getAppWithMetadata } from "@calcom/app-store/_appRegistry";
-import prisma from "@calcom/prisma";
-
-import { inferSSRProps } from "@lib/types/inferSSRProps";
-
-import App from "@components/v2/apps/App";
-
-const components = {
- a: ({ href = "", ...otherProps }: JSX.IntrinsicElements["a"]) => (
-
-
-
- ),
- img: ({ src = "", alt = "", placeholder, ...rest }: JSX.IntrinsicElements["img"]) => (
-
- ),
- // @TODO: In v2 the slider isn't shown anymore. However, to ensure the v1 pages keep
- // working, this component is still rendered in the MDX content. To skip them in the v2
- // content we have to render null here. In v2 the gallery is shown by directly
- // using the `items` property from the MDX's meta data.
- Slider: () => <>>,
-};
-
-function SingleAppPage({ data, source }: inferSSRProps
) {
- return (
- }
- />
- );
-}
-
-export const getStaticPaths: GetStaticPaths<{ slug: string }> = async () => {
- const appStore = await prisma.app.findMany({ select: { slug: true } });
- const paths = appStore.map(({ slug }) => ({ params: { slug } }));
-
- return {
- paths,
- fallback: false,
- };
-};
-
-export const getStaticProps = async (ctx: GetStaticPropsContext) => {
- if (typeof ctx.params?.slug !== "string") return { notFound: true };
-
- const app = await prisma.app.findUnique({
- where: { slug: ctx.params.slug },
- });
-
- if (!app) return { notFound: true };
-
- const singleApp = await getAppWithMetadata(app);
-
- if (!singleApp) return { notFound: true };
-
- const appDirname = app.dirName;
- const README_PATH = path.join(process.cwd(), "..", "..", `packages/app-store/${appDirname}/README.mdx`);
- const postFilePath = path.join(README_PATH);
- let source = "";
-
- try {
- /* If the app doesn't have a README we fallback to the package description */
- source = fs.readFileSync(postFilePath).toString();
- } catch (error) {
- console.log(`No README.mdx provided for: ${appDirname}`);
- source = singleApp.description;
- }
-
- const { content, data } = matter(source);
- const mdxSource = await serialize(content, { scope: data });
-
- return {
- props: {
- source: mdxSource,
- data: singleApp,
- },
- };
-};
-
-export default SingleAppPage;
diff --git a/apps/web/pages/v2/apps/[slug]/setup.tsx b/apps/web/pages/v2/apps/[slug]/setup.tsx
deleted file mode 100644
index 4cd7a56216..0000000000
--- a/apps/web/pages/v2/apps/[slug]/setup.tsx
+++ /dev/null
@@ -1,36 +0,0 @@
-import { GetStaticPaths, InferGetStaticPropsType } from "next";
-import { useSession } from "next-auth/react";
-import { useRouter } from "next/router";
-
-import { getStaticProps } from "@calcom/app-store/_pages/setup/_getStaticProps";
-import { AppSetupPage } from "@calcom/app-store/_pages/v2/setup";
-
-export default function SetupInformation(props: InferGetStaticPropsType) {
- const router = useRouter();
- const slug = router.query.slug as string;
- const { status } = useSession();
-
- if (status === "loading") {
- return ;
- }
-
- if (status === "unauthenticated") {
- router.replace({
- pathname: "/auth/login",
- query: {
- callbackUrl: `/apps/${slug}/setup`,
- },
- });
- }
-
- return ;
-}
-
-export const getStaticPaths: GetStaticPaths = async () => {
- return {
- paths: [],
- fallback: "blocking",
- };
-};
-
-export { getStaticProps };
diff --git a/apps/web/pages/v2/auth/login.tsx b/apps/web/pages/v2/auth/login.tsx
deleted file mode 100644
index 4fa4f9cd1c..0000000000
--- a/apps/web/pages/v2/auth/login.tsx
+++ /dev/null
@@ -1,241 +0,0 @@
-import classNames from "classnames";
-import { GetServerSidePropsContext } from "next";
-import { getCsrfToken, signIn } from "next-auth/react";
-import Link from "next/link";
-import { useRouter } from "next/router";
-import { useState } from "react";
-import { useForm } from "react-hook-form";
-import { FaGoogle } from "react-icons/fa";
-
-import { getSafeRedirectUrl } from "@calcom/lib/getSafeRedirectUrl";
-import { useLocale } from "@calcom/lib/hooks/useLocale";
-import { collectPageParameters, telemetryEventTypes, useTelemetry } from "@calcom/lib/telemetry";
-import prisma from "@calcom/prisma";
-import { Icon } from "@calcom/ui";
-import { Alert } from "@calcom/ui/Alert";
-import { Button, EmailField, Form, PasswordField } from "@calcom/ui/v2";
-import SAMLLogin from "@calcom/ui/v2/modules/auth/SAMLLogin";
-
-import { ErrorCode, getSession } from "@lib/auth";
-import { WEBAPP_URL, WEBSITE_URL } from "@lib/config/constants";
-import { hostedCal, isSAMLLoginEnabled, samlProductID, samlTenantID } from "@lib/saml";
-import { inferSSRProps } from "@lib/types/inferSSRProps";
-
-import AddToHomescreen from "@components/AddToHomescreen";
-import TwoFactor from "@components/auth/TwoFactor";
-import AuthContainer from "@components/v2/ui/AuthContainer";
-
-import { IS_GOOGLE_LOGIN_ENABLED } from "@server/lib/constants";
-import { ssrInit } from "@server/lib/ssr";
-
-interface LoginValues {
- email: string;
- password: string;
- totpCode: string;
- csrfToken: string;
-}
-
-export default function Login({
- csrfToken,
- isGoogleLoginEnabled,
- isSAMLLoginEnabled,
- hostedCal,
- samlTenantID,
- samlProductID,
-}: inferSSRProps) {
- const { t } = useLocale();
- const router = useRouter();
- const form = useForm();
- const { formState } = form;
- const { isSubmitting } = formState;
-
- const [twoFactorRequired, setTwoFactorRequired] = useState(false);
- const [errorMessage, setErrorMessage] = useState(null);
-
- const errorMessages: { [key: string]: string } = {
- // [ErrorCode.SecondFactorRequired]: t("2fa_enabled_instructions"),
- [ErrorCode.IncorrectPassword]: `${t("incorrect_password")} ${t("please_try_again")}`,
- [ErrorCode.UserNotFound]: t("no_account_exists"),
- [ErrorCode.IncorrectTwoFactorCode]: `${t("incorrect_2fa_code")} ${t("please_try_again")}`,
- [ErrorCode.InternalServerError]: `${t("something_went_wrong")} ${t("please_try_again_and_contact_us")}`,
- [ErrorCode.ThirdPartyIdentityProviderEnabled]: t("account_created_with_identity_provider"),
- };
-
- const telemetry = useTelemetry();
-
- let callbackUrl = typeof router.query?.callbackUrl === "string" ? router.query.callbackUrl : "";
-
- if (/"\//.test(callbackUrl)) callbackUrl = callbackUrl.substring(1);
-
- // If not absolute URL, make it absolute
- if (!/^https?:\/\//.test(callbackUrl)) {
- callbackUrl = `${WEBAPP_URL}/${callbackUrl}`;
- }
-
- const safeCallbackUrl = getSafeRedirectUrl(callbackUrl);
-
- callbackUrl = safeCallbackUrl || "";
-
- const LoginFooter = (
-
- {t("dont_have_an_account")}
-
- );
-
- const TwoFactorFooter = (
- {
- setTwoFactorRequired(false);
- form.setValue("totpCode", "");
- }}
- StartIcon={Icon.FiArrowLeft}
- color="minimal">
- {t("go_back")}
-
- );
-
- return (
- <>
-
-
- {!twoFactorRequired && (
- <>
- {(isGoogleLoginEnabled || isSAMLLoginEnabled) &&
}
-
- {isGoogleLoginEnabled && (
- {
- e.preventDefault();
- // track Google logins. Without personal data/payload
- telemetry.event(telemetryEventTypes.googleLogin, collectPageParameters());
- await signIn("google");
- }}>
- {t("signin_with_google")}
-
- )}
- {isSAMLLoginEnabled && (
-
- )}
-
- >
- )}
-
-
- >
- );
-}
-
-export async function getServerSideProps(context: GetServerSidePropsContext) {
- const { req } = context;
- const session = await getSession({ req });
- const ssr = await ssrInit(context);
-
- if (session) {
- return {
- redirect: {
- destination: "/",
- permanent: false,
- },
- };
- }
-
- const userCount = await prisma.user.count();
- if (userCount === 0) {
- // Proceed to new onboarding to create first admin user
- return {
- redirect: {
- destination: "/auth/setup",
- permanent: false,
- },
- };
- }
-
- return {
- props: {
- csrfToken: await getCsrfToken(context),
- trpcState: ssr.dehydrate(),
- isGoogleLoginEnabled: IS_GOOGLE_LOGIN_ENABLED,
- isSAMLLoginEnabled,
- hostedCal,
- samlTenantID,
- samlProductID,
- },
- };
-}
diff --git a/apps/web/pages/v2/workflows/[workflow].tsx b/apps/web/pages/workflows/[workflow].tsx
similarity index 100%
rename from apps/web/pages/v2/workflows/[workflow].tsx
rename to apps/web/pages/workflows/[workflow].tsx
diff --git a/apps/web/pages/v2/workflows/index.tsx b/apps/web/pages/workflows/index.tsx
similarity index 100%
rename from apps/web/pages/v2/workflows/index.tsx
rename to apps/web/pages/workflows/index.tsx