Compare commits

...

20 Commits

Author SHA1 Message Date
zomars 64fc828744 Merge branch 'main' into feat/calcom-auth
# Conflicts:
#	.gitmodules
#	apps/console
#	apps/web/pages/settings/my-account/conferencing.tsx
#	apps/website
#	yarn.lock
2023-01-20 16:10:02 -07:00
zomars e21f86fb17 Import fixes 2023-01-18 10:26:25 -07:00
zomars 796e9edccb Merge branch 'main' into feat/calcom-auth 2023-01-18 10:20:15 -07:00
zomars ef9bbaf889 Fixes 2023-01-18 10:20:03 -07:00
zomars 3ae98e537e Update .gitmodules 2023-01-18 09:47:04 -07:00
zomars f25fae335d Fixes 2023-01-17 16:23:18 -07:00
zomars 213489c202 Revert more stuff 2023-01-17 16:18:54 -07:00
zomars 2bba63f9f0 Fixes 2023-01-17 16:08:40 -07:00
zomars 7bc14e8cf9 Revert abstraction 2023-01-17 16:05:08 -07:00
zomars c8d573983d WIP 2023-01-17 15:51:55 -07:00
zomars 798adb2627 WIP 2023-01-17 15:44:23 -07:00
zomars b8978b48bf Sync submodule 2023-01-17 15:35:03 -07:00
zomars 1c12339479 WIP 2023-01-17 15:09:36 -07:00
zomars 94e6007245 Merge branch 'main' into feat/calcom-auth 2023-01-17 13:00:16 -07:00
zomars 1046f92c76 Merge branch 'main' into feat/calcom-auth 2023-01-16 15:39:15 -07:00
zomars 50ee78a92b WIP 2023-01-13 15:08:32 -07:00
zomars 6c2919cb91 Updates packages 2023-01-13 12:38:17 -07:00
zomars 1a1e267b29 Merge branch 'main' into feat/calcom-auth
# Conflicts:
#	yarn.lock
2023-01-13 12:32:33 -07:00
Omar López f5580a44ac
Merge branch 'main' into feat/calcom-auth 2022-12-14 18:05:09 -07:00
zomars 68b41f2816 WIP 2022-12-14 18:04:10 -07:00
112 changed files with 342 additions and 363 deletions

1
apps/auth Submodule

@ -0,0 +1 @@
Subproject commit a74ac5ec4c13ebf14a827f8cfc4704e271fa0c6b

View File

@ -1,3 +1,4 @@
import { UserPermissionRole } from "@prisma/client";
import { useSession } from "next-auth/react"; import { useSession } from "next-auth/react";
import { useRouter } from "next/router"; import { useRouter } from "next/router";
import React, { ComponentProps, useEffect } from "react"; import React, { ComponentProps, useEffect } from "react";
@ -6,8 +7,6 @@ import SettingsLayout from "@calcom/features/settings/layouts/SettingsLayout";
import Shell from "@calcom/features/shell/Shell"; import Shell from "@calcom/features/shell/Shell";
import { ErrorBoundary } from "@calcom/ui"; import { ErrorBoundary } from "@calcom/ui";
import { UserPermissionRole } from ".prisma/client";
export default function AdminLayout({ export default function AdminLayout({
children, children,
...rest ...rest

View File

@ -1,6 +1,6 @@
import { SyntheticEvent, useState } from "react"; import { SyntheticEvent, useState } from "react";
import { ErrorCode } from "@calcom/lib/auth"; import { ErrorCode } from "@calcom/features/auth/lib";
import { useLocale } from "@calcom/lib/hooks/useLocale"; import { useLocale } from "@calcom/lib/hooks/useLocale";
import { Button, showToast } from "@calcom/ui"; import { Button, showToast } from "@calcom/ui";

View File

@ -1,7 +1,7 @@
import { useState } from "react"; import { useState } from "react";
import { useForm } from "react-hook-form"; import { useForm } from "react-hook-form";
import { ErrorCode } from "@calcom/lib/auth"; import { ErrorCode } from "@calcom/features/auth/lib";
import { useLocale } from "@calcom/lib/hooks/useLocale"; import { useLocale } from "@calcom/lib/hooks/useLocale";
import { Button, Dialog, DialogContent, Form, Label, PasswordField } from "@calcom/ui"; import { Button, Dialog, DialogContent, Form, Label, PasswordField } from "@calcom/ui";

View File

@ -1,7 +1,7 @@
import React, { BaseSyntheticEvent, useState } from "react"; import React, { BaseSyntheticEvent, useState } from "react";
import { useForm } from "react-hook-form"; import { useForm } from "react-hook-form";
import { ErrorCode } from "@calcom/lib/auth"; import { ErrorCode } from "@calcom/features/auth/lib";
import { useLocale } from "@calcom/lib/hooks/useLocale"; import { useLocale } from "@calcom/lib/hooks/useLocale";
import { Button, Dialog, DialogContent, Form } from "@calcom/ui"; import { Button, Dialog, DialogContent, Form } from "@calcom/ui";

View File

@ -1,7 +1,7 @@
import { useState } from "react"; import { useState } from "react";
import { useForm } from "react-hook-form"; import { useForm } from "react-hook-form";
import { ErrorCode } from "@calcom/lib/auth"; import { ErrorCode } from "@calcom/features/auth/lib";
import { useLocale } from "@calcom/lib/hooks/useLocale"; import { useLocale } from "@calcom/lib/hooks/useLocale";
import { Button, Dialog, DialogContent, Form, Label, PasswordField } from "@calcom/ui"; import { Button, Dialog, DialogContent, Form, Label, PasswordField } from "@calcom/ui";

View File

@ -1,7 +1,7 @@
import React, { BaseSyntheticEvent, useState } from "react"; import React, { BaseSyntheticEvent, useState } from "react";
import { useForm } from "react-hook-form"; import { useForm } from "react-hook-form";
import { ErrorCode } from "@calcom/lib/auth"; import { ErrorCode } from "@calcom/features/auth/lib";
import { useLocale } from "@calcom/lib/hooks/useLocale"; import { useLocale } from "@calcom/lib/hooks/useLocale";
import { Button, Dialog, DialogContent, Form, TextField } from "@calcom/ui"; import { Button, Dialog, DialogContent, Form, TextField } from "@calcom/ui";

View File

@ -1,44 +0,0 @@
import { IdentityProvider } from "@prisma/client";
import { compare, hash } from "bcryptjs";
import { Session } from "next-auth";
import { getSession as getSessionInner, GetSessionParams } from "next-auth/react";
/** @deprecated use the one from `@calcom/lib/auth` */
export async function hashPassword(password: string) {
const hashedPassword = await hash(password, 12);
return hashedPassword;
}
/** @deprecated use the one from `@calcom/lib/auth` */
export async function verifyPassword(password: string, hashedPassword: string) {
const isValid = await compare(password, hashedPassword);
return isValid;
}
/** @deprecated use the one from `@calcom/lib/auth` */
export async function getSession(options: GetSessionParams): Promise<Session | null> {
const session = await getSessionInner(options);
// that these are equal are ensured in `[...nextauth]`'s callback
return session as Session | null;
}
/** @deprecated use the one from `@calcom/lib/auth` */
export enum ErrorCode {
UserNotFound = "user-not-found",
IncorrectPassword = "incorrect-password",
UserMissingPassword = "missing-password",
TwoFactorDisabled = "two-factor-disabled",
TwoFactorAlreadyEnabled = "two-factor-already-enabled",
TwoFactorSetupRequired = "two-factor-setup-required",
SecondFactorRequired = "second-factor-required",
IncorrectTwoFactorCode = "incorrect-two-factor-code",
InternalServerError = "internal-server-error",
NewPasswordMatchesOld = "new-password-matches-old",
ThirdPartyIdentityProviderEnabled = "third-party-identity-provider-enabled",
RateLimitExceeded = "rate-limit-exceeded",
InvalidPassword = "invalid-password",
}
/** @deprecated use the one from `@calcom/lib/auth` */
export const identityProviderNameMap: { [key in IdentityProvider]: string } = {
[IdentityProvider.CAL]: "Cal",
[IdentityProvider.GOOGLE]: "Google",
[IdentityProvider.SAML]: "SAML",
};

View File

@ -2,20 +2,6 @@ require("dotenv").config({ path: "../../.env" });
const CopyWebpackPlugin = require("copy-webpack-plugin"); const CopyWebpackPlugin = require("copy-webpack-plugin");
const { withSentryConfig } = require("@sentry/nextjs"); const { withSentryConfig } = require("@sentry/nextjs");
const os = require("os"); const os = require("os");
const withTM = require("next-transpile-modules")([
"@calcom/app-store",
"@calcom/core",
"@calcom/dayjs",
"@calcom/emails",
"@calcom/embed-core",
"@calcom/embed-react",
"@calcom/embed-snippet",
"@calcom/features",
"@calcom/lib",
"@calcom/prisma",
"@calcom/trpc",
"@calcom/ui",
]);
const { withAxiom } = require("next-axiom"); const { withAxiom } = require("next-axiom");
const { i18n } = require("./next-i18next.config"); const { i18n } = require("./next-i18next.config");
@ -74,11 +60,24 @@ if (process.env.ANALYZE === "true") {
plugins.push(withBundleAnalyzer); plugins.push(withBundleAnalyzer);
} }
plugins.push(withTM);
plugins.push(withAxiom); plugins.push(withAxiom);
/** @type {import("next").NextConfig} */ /** @type {import("next").NextConfig} */
const nextConfig = { const nextConfig = {
transpilePackages: [
"@calcom/app-store",
"@calcom/core",
"@calcom/dayjs",
"@calcom/emails",
"@calcom/embed-core",
"@calcom/embed-react",
"@calcom/embed-snippet",
"@calcom/features",
"@calcom/lib",
"@calcom/prisma",
"@calcom/trpc",
"@calcom/ui",
],
i18n, i18n,
productionBrowserSourceMaps: true, productionBrowserSourceMaps: true,
/* We already do type check on GH actions */ /* We already do type check on GH actions */
@ -138,7 +137,7 @@ const nextConfig = {
return config; return config;
}, },
async rewrites() { async rewrites() {
return [ const rewrites = [
{ {
source: "/:user/avatar.png", source: "/:user/avatar.png",
destination: "/api/user/avatar?username=:user", destination: "/api/user/avatar?username=:user",
@ -175,6 +174,14 @@ const nextConfig = {
destination: process.env.NEXT_PUBLIC_EMBED_LIB_URL?, destination: process.env.NEXT_PUBLIC_EMBED_LIB_URL?,
}, */ }, */
]; ];
// So that we can opt-in to use an external auth server
if (process.env.NEXTAUTH_URL !== process.env.NEXT_PUBLIC_WEBAPP_URL) {
rewrites.push({
source: "/api/auth/:rest*",
destination: process.env.NEXTAUTH_URL + "/api/auth/:rest*",
});
}
return rewrites;
}, },
async redirects() { async redirects() {
const redirects = [ const redirects = [

View File

@ -23,7 +23,6 @@
"yarn": ">=1.19.0 < 2.0.0" "yarn": ">=1.19.0 < 2.0.0"
}, },
"dependencies": { "dependencies": {
"@boxyhq/saml-jackson": "1.3.6",
"@calcom/app-store": "*", "@calcom/app-store": "*",
"@calcom/app-store-cli": "*", "@calcom/app-store-cli": "*",
"@calcom/core": "*", "@calcom/core": "*",

View File

@ -4,12 +4,11 @@ import { useRouter } from "next/router";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { COMPANY_NAME, DEVELOPER_DOCS, DOCS_URL, JOIN_SLACK, WEBSITE_URL } from "@calcom/lib/constants"; import { COMPANY_NAME, DEVELOPER_DOCS, DOCS_URL, JOIN_SLACK, WEBSITE_URL } from "@calcom/lib/constants";
import { ssgInit } from "@calcom/trpc/server/ssg";
import { Icon, HeadSeo } from "@calcom/ui"; import { Icon, HeadSeo } from "@calcom/ui";
import { useLocale } from "@lib/hooks/useLocale"; import { useLocale } from "@lib/hooks/useLocale";
import { ssgInit } from "@server/lib/ssg";
export default function Custom404() { export default function Custom404() {
const { t } = useLocale(); const { t } = useLocale();

View File

@ -26,6 +26,7 @@ import { collectPageParameters, telemetryEventTypes, useTelemetry } from "@calco
import prisma from "@calcom/prisma"; import prisma from "@calcom/prisma";
import { baseEventTypeSelect } from "@calcom/prisma/selects"; import { baseEventTypeSelect } from "@calcom/prisma/selects";
import { EventTypeMetaDataSchema } from "@calcom/prisma/zod-utils"; import { EventTypeMetaDataSchema } from "@calcom/prisma/zod-utils";
import { ssrInit } from "@calcom/trpc/server/ssr";
import { Icon, HeadSeo, AvatarGroup } from "@calcom/ui"; import { Icon, HeadSeo, AvatarGroup } from "@calcom/ui";
import { inferSSRProps } from "@lib/types/inferSSRProps"; import { inferSSRProps } from "@lib/types/inferSSRProps";
@ -33,8 +34,6 @@ import { EmbedProps } from "@lib/withEmbedSsr";
import { AvatarSSR } from "@components/ui/AvatarSSR"; import { AvatarSSR } from "@components/ui/AvatarSSR";
import { ssrInit } from "@server/lib/ssr";
export default function User(props: inferSSRProps<typeof getServerSideProps> & EmbedProps) { export default function User(props: inferSSRProps<typeof getServerSideProps> & EmbedProps) {
const { users, profile, eventTypes, isDynamicGroup, dynamicNames, dynamicUsernames, isSingleUser } = props; const { users, profile, eventTypes, isDynamicGroup, dynamicNames, dynamicUsernames, isSingleUser } = props;
const [user] = users; //To be used when we only have a single user, not dynamic group const [user] = users; //To be used when we only have a single user, not dynamic group

View File

@ -62,7 +62,7 @@ Type.isThemeSupported = true;
async function getUserPageProps(context: GetStaticPropsContext) { async function getUserPageProps(context: GetStaticPropsContext) {
const { type: slug, user: username } = paramsSchema.parse(context.params); const { type: slug, user: username } = paramsSchema.parse(context.params);
const { ssgInit } = await import("@server/lib/ssg"); const { ssgInit } = await import("@calcom/trpc/server/ssg");
const ssg = await ssgInit(context); const ssg = await ssgInit(context);
const user = await prisma.user.findUnique({ const user = await prisma.user.findUnique({
where: { where: {
@ -186,7 +186,7 @@ async function getUserPageProps(context: GetStaticPropsContext) {
} }
async function getDynamicGroupPageProps(context: GetStaticPropsContext) { async function getDynamicGroupPageProps(context: GetStaticPropsContext) {
const { ssgInit } = await import("@server/lib/ssg"); const { ssgInit } = await import("@calcom/trpc/server/ssg");
const ssg = await ssgInit(context); const ssg = await ssgInit(context);
const { type: typeParam, user: userParam } = paramsSchema.parse(context.params); const { type: typeParam, user: userParam } = paramsSchema.parse(context.params);
const usernameList = getUsernameList(userParam); const usernameList = getUsernameList(userParam);

View File

@ -13,6 +13,7 @@ import { useLocale } from "@calcom/lib/hooks/useLocale";
import { bookEventTypeSelect } from "@calcom/prisma"; import { bookEventTypeSelect } from "@calcom/prisma";
import prisma from "@calcom/prisma"; import prisma from "@calcom/prisma";
import { customInputSchema, EventTypeMetaDataSchema } from "@calcom/prisma/zod-utils"; import { customInputSchema, EventTypeMetaDataSchema } from "@calcom/prisma/zod-utils";
import { ssrInit } from "@calcom/trpc/server/ssr";
import { asStringOrNull, asStringOrThrow } from "@lib/asStringOrNull"; import { asStringOrNull, asStringOrThrow } from "@lib/asStringOrNull";
import getBooking, { GetBookingType } from "@lib/getBooking"; import getBooking, { GetBookingType } from "@lib/getBooking";
@ -20,8 +21,6 @@ import { inferSSRProps } from "@lib/types/inferSSRProps";
import BookingPage from "@components/booking/pages/BookingPage"; import BookingPage from "@components/booking/pages/BookingPage";
import { ssrInit } from "@server/lib/ssr";
export type BookPageProps = inferSSRProps<typeof getServerSideProps>; export type BookPageProps = inferSSRProps<typeof getServerSideProps>;
export default function Book(props: BookPageProps) { export default function Book(props: BookPageProps) {

View File

@ -0,0 +1 @@
export { default } from "@calcom/features/auth/api/dynamicHandler";

View File

@ -1,7 +1,7 @@
import type { NextApiRequest } from "next"; import type { NextApiRequest } from "next";
import { getSession } from "@calcom/features/auth/lib";
import handleNewBooking from "@calcom/features/bookings/lib/handleNewBooking"; import handleNewBooking from "@calcom/features/bookings/lib/handleNewBooking";
import { getSession } from "@calcom/lib/auth";
import { defaultResponder } from "@calcom/lib/server"; import { defaultResponder } from "@calcom/lib/server";
async function handler(req: NextApiRequest & { userId?: number }) { async function handler(req: NextApiRequest & { userId?: number }) {

View File

@ -1,7 +1,7 @@
import type { NextApiRequest } from "next"; import type { NextApiRequest } from "next";
import { getSession } from "@calcom/features/auth/lib";
import handleCancelBooking from "@calcom/features/bookings/lib/handleCancelBooking"; import handleCancelBooking from "@calcom/features/bookings/lib/handleCancelBooking";
import { getSession } from "@calcom/lib/auth";
import { defaultResponder, defaultHandler } from "@calcom/lib/server"; import { defaultResponder, defaultHandler } from "@calcom/lib/server";
async function handler(req: NextApiRequest & { userId?: number }) { async function handler(req: NextApiRequest & { userId?: number }) {

View File

@ -2,7 +2,7 @@ import type { NextApiRequest, NextApiResponse } from "next";
import { z } from "zod"; import { z } from "zod";
import { fetcher } from "@calcom/app-store/dailyvideo/lib/VideoApiAdapter"; import { fetcher } from "@calcom/app-store/dailyvideo/lib/VideoApiAdapter";
import { getSession } from "@calcom/lib/auth"; import { getSession } from "@calcom/features/auth/lib";
import { defaultHandler, defaultResponder } from "@calcom/lib/server"; import { defaultHandler, defaultResponder } from "@calcom/lib/server";
const getAccessLinkSchema = z.union([ const getAccessLinkSchema = z.union([

View File

@ -2,7 +2,7 @@ import { NextApiRequest, NextApiResponse } from "next";
import type { Session } from "next-auth"; import type { Session } from "next-auth";
import getInstalledAppPath from "@calcom/app-store/_utils/getInstalledAppPath"; import getInstalledAppPath from "@calcom/app-store/_utils/getInstalledAppPath";
import { getSession } from "@calcom/lib/auth"; import { getSession } from "@calcom/features/auth/lib";
import { deriveAppDictKeyFromType } from "@calcom/lib/deriveAppDictKeyFromType"; import { deriveAppDictKeyFromType } from "@calcom/lib/deriveAppDictKeyFromType";
import prisma from "@calcom/prisma"; import prisma from "@calcom/prisma";
import type { AppDeclarativeHandler, AppHandler } from "@calcom/types/AppHandler"; import type { AppDeclarativeHandler, AppHandler } from "@calcom/types/AppHandler";

View File

@ -4,13 +4,12 @@ import { useRouter } from "next/router";
import RoutingFormsRoutingConfig from "@calcom/app-store/ee/routing-forms/pages/app-routing.config"; import RoutingFormsRoutingConfig from "@calcom/app-store/ee/routing-forms/pages/app-routing.config";
import TypeformRoutingConfig from "@calcom/app-store/typeform/pages/app-routing.config"; import TypeformRoutingConfig from "@calcom/app-store/typeform/pages/app-routing.config";
import prisma from "@calcom/prisma"; import prisma from "@calcom/prisma";
import { ssrInit } from "@calcom/trpc/server/ssr";
import { AppGetServerSideProps } from "@calcom/types/AppGetServerSideProps"; import { AppGetServerSideProps } from "@calcom/types/AppGetServerSideProps";
import { AppProps } from "@lib/app-providers"; import { AppProps } from "@lib/app-providers";
import { getSession } from "@lib/auth"; import { getSession } from "@lib/auth";
import { ssrInit } from "@server/lib/ssr";
type AppPageType = { type AppPageType = {
getServerSideProps: AppGetServerSideProps; getServerSideProps: AppGetServerSideProps;
// A component than can accept any properties // A component than can accept any properties

View File

@ -2,10 +2,11 @@ import { GetServerSidePropsContext } from "next";
import { ChangeEventHandler, useState } from "react"; import { ChangeEventHandler, useState } from "react";
import { getAppRegistry, getAppRegistryWithCredentials } from "@calcom/app-store/_appRegistry"; import { getAppRegistry, getAppRegistryWithCredentials } from "@calcom/app-store/_appRegistry";
import { getSession } from "@calcom/features/auth/lib";
import { classNames } from "@calcom/lib"; import { classNames } from "@calcom/lib";
import { getSession } from "@calcom/lib/auth";
import { useLocale } from "@calcom/lib/hooks/useLocale"; import { useLocale } from "@calcom/lib/hooks/useLocale";
import type { AppCategories } from "@calcom/prisma/client"; import type { AppCategories } from "@calcom/prisma/client";
import { ssgInit } from "@calcom/trpc/server/ssg";
import { inferSSRProps } from "@calcom/types/inferSSRProps"; import { inferSSRProps } from "@calcom/types/inferSSRProps";
import { import {
AllApps, AllApps,
@ -19,8 +20,6 @@ import {
import AppsLayout from "@components/apps/layouts/AppsLayout"; import AppsLayout from "@components/apps/layouts/AppsLayout";
import { ssgInit } from "@server/lib/ssg";
const tabs: HorizontalTabItemProps[] = [ const tabs: HorizontalTabItemProps[] = [
{ {
name: "app_store", name: "app_store",

View File

@ -3,13 +3,11 @@ import Link from "next/link";
import { useRouter } from "next/router"; import { useRouter } from "next/router";
import z from "zod"; import z from "zod";
import AuthContainer from "@calcom/features/auth/components/AuthContainer";
import { useLocale } from "@calcom/lib/hooks/useLocale"; import { useLocale } from "@calcom/lib/hooks/useLocale";
import { ssgInit } from "@calcom/trpc/server/ssg";
import { Button, Icon, SkeletonText } from "@calcom/ui"; import { Button, Icon, SkeletonText } from "@calcom/ui";
import AuthContainer from "@components/ui/AuthContainer";
import { ssgInit } from "@server/lib/ssg";
const querySchema = z.object({ const querySchema = z.object({
error: z.string().optional(), error: z.string().optional(),
}); });

View File

@ -6,13 +6,11 @@ import Link from "next/link";
import React, { useMemo } from "react"; import React, { useMemo } from "react";
import dayjs from "@calcom/dayjs"; import dayjs from "@calcom/dayjs";
import AuthContainer from "@calcom/features/auth/components/AuthContainer";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import prisma from "@calcom/prisma"; import prisma from "@calcom/prisma";
import { Button, TextField } from "@calcom/ui"; import { Button, TextField } from "@calcom/ui";
import { useLocale } from "@lib/hooks/useLocale";
import AuthContainer from "@components/ui/AuthContainer";
type Props = { type Props = {
id: string; id: string;
resetPasswordRequest: ResetPasswordRequest; resetPasswordRequest: ResetPasswordRequest;

View File

@ -5,13 +5,11 @@ import Link from "next/link";
import { useRouter } from "next/router"; import { useRouter } from "next/router";
import React, { SyntheticEvent } from "react"; import React, { SyntheticEvent } from "react";
import AuthContainer from "@calcom/features/auth/components/AuthContainer";
import { getSession } from "@calcom/features/auth/lib";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { Button, EmailField } from "@calcom/ui"; import { Button, EmailField } from "@calcom/ui";
import { getSession } from "@lib/auth";
import { useLocale } from "@lib/hooks/useLocale";
import AuthContainer from "@components/ui/AuthContainer";
export default function ForgotPassword({ csrfToken }: { csrfToken: string }) { export default function ForgotPassword({ csrfToken }: { csrfToken: string }) {
const { t, i18n } = useLocale(); const { t, i18n } = useLocale();
const [loading, setLoading] = React.useState(false); const [loading, setLoading] = React.useState(false);

View File

@ -7,24 +7,21 @@ import { useState } from "react";
import { FormProvider, useForm } from "react-hook-form"; import { FormProvider, useForm } from "react-hook-form";
import { FaGoogle } from "react-icons/fa"; import { FaGoogle } from "react-icons/fa";
import { SAMLLogin } from "@calcom/features/auth/SAMLLogin"; import AuthContainer from "@calcom/features/auth/components/AuthContainer";
import { SAMLLogin } from "@calcom/features/auth/components/SAMLLogin";
import TwoFactor from "@calcom/features/auth/components/TwoFactor";
import { ErrorCode, getSession } from "@calcom/features/auth/lib";
import { isSAMLLoginEnabled, samlProductID, samlTenantID } from "@calcom/features/ee/sso/lib/saml"; import { isSAMLLoginEnabled, samlProductID, samlTenantID } from "@calcom/features/ee/sso/lib/saml";
import { WEBAPP_URL, WEBSITE_URL } from "@calcom/lib/constants";
import { getSafeRedirectUrl } from "@calcom/lib/getSafeRedirectUrl"; import { getSafeRedirectUrl } from "@calcom/lib/getSafeRedirectUrl";
import { useLocale } from "@calcom/lib/hooks/useLocale"; import { useLocale } from "@calcom/lib/hooks/useLocale";
import { collectPageParameters, telemetryEventTypes, useTelemetry } from "@calcom/lib/telemetry"; import { collectPageParameters, telemetryEventTypes, useTelemetry } from "@calcom/lib/telemetry";
import prisma from "@calcom/prisma"; import prisma from "@calcom/prisma";
import { Alert, Button, EmailField, Icon, PasswordField } from "@calcom/ui"; import { ssrInit } from "@calcom/trpc/server/ssr";
import { inferSSRProps } from "@calcom/types/inferSSRProps";
import { ErrorCode, getSession } from "@lib/auth"; import { AddToHomescreen, Alert, Button, EmailField, Icon, PasswordField } from "@calcom/ui";
import { WEBAPP_URL, WEBSITE_URL } from "@lib/config/constants";
import { inferSSRProps } from "@lib/types/inferSSRProps";
import AddToHomescreen from "@components/AddToHomescreen";
import TwoFactor from "@components/auth/TwoFactor";
import AuthContainer from "@components/ui/AuthContainer";
import { IS_GOOGLE_LOGIN_ENABLED } from "@server/lib/constants"; import { IS_GOOGLE_LOGIN_ENABLED } from "@server/lib/constants";
import { ssrInit } from "@server/lib/ssr";
interface LoginValues { interface LoginValues {
email: string; email: string;

View File

@ -3,16 +3,14 @@ import { signOut, useSession } from "next-auth/react";
import { useRouter } from "next/router"; import { useRouter } from "next/router";
import { useEffect } from "react"; import { useEffect } from "react";
import AuthContainer from "@calcom/features/auth/components/AuthContainer";
import { WEBSITE_URL } from "@calcom/lib/constants"; import { WEBSITE_URL } from "@calcom/lib/constants";
import { useLocale } from "@calcom/lib/hooks/useLocale"; import { useLocale } from "@calcom/lib/hooks/useLocale";
import { ssrInit } from "@calcom/trpc/server/ssr";
import { Button, Icon } from "@calcom/ui"; import { Button, Icon } from "@calcom/ui";
import { inferSSRProps } from "@lib/types/inferSSRProps"; import { inferSSRProps } from "@lib/types/inferSSRProps";
import AuthContainer from "@components/ui/AuthContainer";
import { ssrInit } from "@server/lib/ssr";
type Props = inferSSRProps<typeof getServerSideProps>; type Props = inferSSRProps<typeof getServerSideProps>;
export default function Logout(props: Props) { export default function Logout(props: Props) {

View File

@ -3,15 +3,14 @@ import { GetServerSidePropsContext } from "next";
import { useState } from "react"; import { useState } from "react";
import AdminAppsList from "@calcom/features/apps/AdminAppsList"; import AdminAppsList from "@calcom/features/apps/AdminAppsList";
import { getSession } from "@calcom/lib/auth"; import SetupFormStep1 from "@calcom/features/auth/components/SetupFormStep1";
import StepDone from "@calcom/features/auth/components/StepDone";
import { getSession } from "@calcom/features/auth/lib";
import { useLocale } from "@calcom/lib/hooks/useLocale"; import { useLocale } from "@calcom/lib/hooks/useLocale";
import prisma from "@calcom/prisma"; import prisma from "@calcom/prisma";
import { inferSSRProps } from "@calcom/types/inferSSRProps"; import { inferSSRProps } from "@calcom/types/inferSSRProps";
import { WizardForm } from "@calcom/ui"; import { WizardForm } from "@calcom/ui";
import SetupFormStep1 from "./steps/SetupFormStep1";
import StepDone from "./steps/StepDone";
export default function Setup(props: inferSSRProps<typeof getServerSideProps>) { export default function Setup(props: inferSSRProps<typeof getServerSideProps>) {
const { t } = useLocale(); const { t } = useLocale();
const [isLoadingStep1, setIsLoadingStep1] = useState(false); const [isLoadingStep1, setIsLoadingStep1] = useState(false);

View File

@ -2,8 +2,10 @@ import { GetServerSidePropsContext } from "next";
import { signIn } from "next-auth/react"; import { signIn } from "next-auth/react";
import { useRouter } from "next/router"; import { useRouter } from "next/router";
import { useEffect } from "react"; import { useEffect } from "react";
import { z } from "zod";
import { getPremiumMonthlyPlanPriceId } from "@calcom/app-store/stripepayment/lib/utils"; import { getPremiumMonthlyPlanPriceId } from "@calcom/app-store/stripepayment/lib/utils";
import { getSession } from "@calcom/features/auth/lib";
import stripe from "@calcom/features/ee/payments/server/stripe"; import stripe from "@calcom/features/ee/payments/server/stripe";
import { import {
hostedCal, hostedCal,
@ -14,14 +16,10 @@ import {
} from "@calcom/features/ee/sso/lib/saml"; } from "@calcom/features/ee/sso/lib/saml";
import { checkUsername } from "@calcom/lib/server/checkUsername"; import { checkUsername } from "@calcom/lib/server/checkUsername";
import prisma from "@calcom/prisma"; import prisma from "@calcom/prisma";
import { ssrInit } from "@calcom/trpc/server/ssr";
import { inferSSRProps } from "@calcom/types/inferSSRProps";
import { asStringOrNull } from "@lib/asStringOrNull"; type SSOProviderPageProps = inferSSRProps<typeof getServerSideProps>;
import { getSession } from "@lib/auth";
import { inferSSRProps } from "@lib/types/inferSSRProps";
import { ssrInit } from "@server/lib/ssr";
export type SSOProviderPageProps = inferSSRProps<typeof getServerSideProps>;
export default function Provider(props: SSOProviderPageProps) { export default function Provider(props: SSOProviderPageProps) {
const router = useRouter(); const router = useRouter();
@ -49,12 +47,18 @@ export default function Provider(props: SSOProviderPageProps) {
return null; return null;
} }
const querySchema = z.object({
provider: z.union([z.string(), z.null()]).optional().default(null),
email: z.union([z.string(), z.null()]).optional().default(null),
username: z.union([z.string(), z.null()]).optional().default(null),
});
export const getServerSideProps = async (context: GetServerSidePropsContext) => { export const getServerSideProps = async (context: GetServerSidePropsContext) => {
// get query params and typecast them to string const {
// (would be even better to assert them instead of typecasting) provider: providerParam,
const providerParam = asStringOrNull(context.query.provider); email: emailParam,
const emailParam = asStringOrNull(context.query.email); username: usernameParam,
const usernameParam = asStringOrNull(context.query.username); } = querySchema.parse(context.query);
const successDestination = "/getting-started" + (usernameParam ? `?username=${usernameParam}` : ""); const successDestination = "/getting-started" + (usernameParam ? `?username=${usernameParam}` : "");
if (!providerParam) { if (!providerParam) {
throw new Error(`File is not named sso/[provider]`); throw new Error(`File is not named sso/[provider]`);

View File

@ -1,16 +1,13 @@
import { CheckIcon, MailOpenIcon, ExclamationIcon } from "@heroicons/react/outline"; import { CheckIcon, ExclamationIcon, MailOpenIcon } from "@heroicons/react/outline";
import { signIn } from "next-auth/react"; import { signIn } from "next-auth/react";
import Head from "next/head"; import Head from "next/head";
import { useRouter } from "next/router"; import { useRouter } from "next/router";
import * as React from "react"; import { useEffect, useRef, useState } from "react";
import { useEffect, useState, useRef } from "react";
import z from "zod"; import z from "zod";
import { APP_NAME, WEBAPP_URL } from "@calcom/lib/constants"; import { APP_NAME, WEBAPP_URL } from "@calcom/lib/constants";
import { trpc } from "@calcom/trpc/react"; import { trpc } from "@calcom/trpc/react";
import { Button, showToast } from "@calcom/ui"; import { Button, Loader, showToast } from "@calcom/ui";
import Loader from "@components/Loader";
async function sendVerificationLogin(email: string, username: string) { async function sendVerificationLogin(email: string, username: string) {
await signIn("email", { await signIn("email", {

View File

@ -11,6 +11,7 @@ import { useLocale } from "@calcom/lib/hooks/useLocale";
import { stringOrNumber } from "@calcom/prisma/zod-utils"; import { stringOrNumber } from "@calcom/prisma/zod-utils";
import { trpc } from "@calcom/trpc/react"; import { trpc } from "@calcom/trpc/react";
import useMeQuery from "@calcom/trpc/react/hooks/useMeQuery"; import useMeQuery from "@calcom/trpc/react/hooks/useMeQuery";
import { ssrInit } from "@calcom/trpc/server/ssr";
import type { Schedule as ScheduleType, TimeRange, WorkingHours } from "@calcom/types/schedule"; import type { Schedule as ScheduleType, TimeRange, WorkingHours } from "@calcom/types/schedule";
import { import {
Button, Button,
@ -31,8 +32,6 @@ import { HttpError } from "@lib/core/http/error";
import { SelectSkeletonLoader } from "@components/availability/SkeletonLoader"; import { SelectSkeletonLoader } from "@components/availability/SkeletonLoader";
import EditableHeading from "@components/ui/EditableHeading"; import EditableHeading from "@components/ui/EditableHeading";
import { ssrInit } from "@server/lib/ssr";
const querySchema = z.object({ const querySchema = z.object({
schedule: stringOrNumber, schedule: stringOrNumber,
}); });

View File

@ -5,6 +5,7 @@ import { NewScheduleButton, ScheduleListItem } from "@calcom/features/schedules"
import Shell from "@calcom/features/shell/Shell"; import Shell from "@calcom/features/shell/Shell";
import { useLocale } from "@calcom/lib/hooks/useLocale"; import { useLocale } from "@calcom/lib/hooks/useLocale";
import { RouterOutputs, trpc } from "@calcom/trpc/react"; import { RouterOutputs, trpc } from "@calcom/trpc/react";
import { ssrInit } from "@calcom/trpc/server/ssr";
import { EmptyScreen, Icon, showToast } from "@calcom/ui"; import { EmptyScreen, Icon, showToast } from "@calcom/ui";
import { withQuery } from "@lib/QueryCell"; import { withQuery } from "@lib/QueryCell";
@ -12,8 +13,6 @@ import { HttpError } from "@lib/core/http/error";
import SkeletonLoader from "@components/availability/SkeletonLoader"; import SkeletonLoader from "@components/availability/SkeletonLoader";
import { ssrInit } from "@server/lib/ssr";
export function AvailabilityList({ schedules }: RouterOutputs["viewer"]["availability"]["list"]) { export function AvailabilityList({ schedules }: RouterOutputs["viewer"]["availability"]["list"]) {
const { t } = useLocale(); const { t } = useLocale();
const utils = trpc.useContext(); const utils = trpc.useContext();

View File

@ -35,6 +35,7 @@ import { localStorage } from "@calcom/lib/webstorage";
import prisma from "@calcom/prisma"; import prisma from "@calcom/prisma";
import { Prisma } from "@calcom/prisma/client"; import { Prisma } from "@calcom/prisma/client";
import { customInputSchema, EventTypeMetaDataSchema } from "@calcom/prisma/zod-utils"; import { customInputSchema, EventTypeMetaDataSchema } from "@calcom/prisma/zod-utils";
import { ssrInit } from "@calcom/trpc/server/ssr";
import { Button, EmailInput, Icon, HeadSeo } from "@calcom/ui"; import { Button, EmailInput, Icon, HeadSeo } from "@calcom/ui";
import { timeZone } from "@lib/clock"; import { timeZone } from "@lib/clock";
@ -43,8 +44,6 @@ import { inferSSRProps } from "@lib/types/inferSSRProps";
import CancelBooking from "@components/booking/CancelBooking"; import CancelBooking from "@components/booking/CancelBooking";
import EventReservationSchema from "@components/schemas/EventReservationSchema"; import EventReservationSchema from "@components/schemas/EventReservationSchema";
import { ssrInit } from "@server/lib/ssr";
function redirectToExternalUrl(url: string) { function redirectToExternalUrl(url: string) {
window.parent.location.href = url; window.parent.location.href = url;
} }

View File

@ -9,6 +9,7 @@ import BookingLayout from "@calcom/features/bookings/layout/BookingLayout";
import { filterQuerySchema, useFilterQuery } from "@calcom/features/bookings/lib/useFilterQuery"; import { filterQuerySchema, useFilterQuery } from "@calcom/features/bookings/lib/useFilterQuery";
import { useLocale } from "@calcom/lib/hooks/useLocale"; import { useLocale } from "@calcom/lib/hooks/useLocale";
import { RouterOutputs, trpc } from "@calcom/trpc/react"; import { RouterOutputs, trpc } from "@calcom/trpc/react";
import { ssgInit } from "@calcom/trpc/server/ssg";
import { Alert, Button, EmptyScreen, Icon } from "@calcom/ui"; import { Alert, Button, EmptyScreen, Icon } from "@calcom/ui";
import { useInViewObserver } from "@lib/hooks/useInViewObserver"; import { useInViewObserver } from "@lib/hooks/useInViewObserver";
@ -16,8 +17,6 @@ import { useInViewObserver } from "@lib/hooks/useInViewObserver";
import BookingListItem from "@components/booking/BookingListItem"; import BookingListItem from "@components/booking/BookingListItem";
import SkeletonLoader from "@components/booking/SkeletonLoader"; import SkeletonLoader from "@components/booking/SkeletonLoader";
import { ssgInit } from "@server/lib/ssg";
type BookingListingStatus = z.infer<typeof filterQuerySchema>["status"]; type BookingListingStatus = z.infer<typeof filterQuerySchema>["status"];
type BookingOutput = RouterOutputs["viewer"]["bookings"]["get"]["bookings"][0]; type BookingOutput = RouterOutputs["viewer"]["bookings"]["get"]["bookings"][0];

View File

@ -6,6 +6,7 @@ import { parseRecurringEvent } from "@calcom/lib";
import { availiblityPageEventTypeSelect } from "@calcom/prisma"; import { availiblityPageEventTypeSelect } from "@calcom/prisma";
import prisma from "@calcom/prisma"; import prisma from "@calcom/prisma";
import { EventTypeMetaDataSchema } from "@calcom/prisma/zod-utils"; import { EventTypeMetaDataSchema } from "@calcom/prisma/zod-utils";
import { ssrInit } from "@calcom/trpc/server/ssr";
import { getWorkingHours } from "@lib/availability"; import { getWorkingHours } from "@lib/availability";
import { GetBookingType } from "@lib/getBooking"; import { GetBookingType } from "@lib/getBooking";
@ -14,8 +15,6 @@ import { EmbedProps } from "@lib/withEmbedSsr";
import AvailabilityPage from "@components/booking/pages/AvailabilityPage"; import AvailabilityPage from "@components/booking/pages/AvailabilityPage";
import { ssrInit } from "@server/lib/ssr";
export type DynamicAvailabilityPageProps = inferSSRProps<typeof getServerSideProps> & EmbedProps; export type DynamicAvailabilityPageProps = inferSSRProps<typeof getServerSideProps> & EmbedProps;
export default function Type(props: DynamicAvailabilityPageProps) { export default function Type(props: DynamicAvailabilityPageProps) {

View File

@ -5,14 +5,13 @@ import { parseRecurringEvent } from "@calcom/lib";
import prisma from "@calcom/prisma"; import prisma from "@calcom/prisma";
import { bookEventTypeSelect } from "@calcom/prisma/selects"; import { bookEventTypeSelect } from "@calcom/prisma/selects";
import { customInputSchema, EventTypeMetaDataSchema } from "@calcom/prisma/zod-utils"; import { customInputSchema, EventTypeMetaDataSchema } from "@calcom/prisma/zod-utils";
import { ssrInit } from "@calcom/trpc/server/ssr";
import { asStringOrNull, asStringOrThrow } from "@lib/asStringOrNull"; import { asStringOrNull, asStringOrThrow } from "@lib/asStringOrNull";
import { inferSSRProps } from "@lib/types/inferSSRProps"; import { inferSSRProps } from "@lib/types/inferSSRProps";
import BookingPage from "@components/booking/pages/BookingPage"; import BookingPage from "@components/booking/pages/BookingPage";
import { ssrInit } from "@server/lib/ssr";
export type HashLinkPageProps = inferSSRProps<typeof getServerSideProps>; export type HashLinkPageProps = inferSSRProps<typeof getServerSideProps>;
export default function Book(props: HashLinkPageProps) { export default function Book(props: HashLinkPageProps) {

View File

@ -19,6 +19,7 @@ import { HttpError } from "@calcom/lib/http-error";
import prisma from "@calcom/prisma"; import prisma from "@calcom/prisma";
import { customInputSchema, EventTypeMetaDataSchema } from "@calcom/prisma/zod-utils"; import { customInputSchema, EventTypeMetaDataSchema } from "@calcom/prisma/zod-utils";
import { trpc, RouterOutputs } from "@calcom/trpc/react"; import { trpc, RouterOutputs } from "@calcom/trpc/react";
import { ssrInit } from "@calcom/trpc/server/ssr";
import type { BookingLimit, RecurringEvent } from "@calcom/types/Calendar"; import type { BookingLimit, RecurringEvent } from "@calcom/types/Calendar";
import { Form, showToast } from "@calcom/ui"; import { Form, showToast } from "@calcom/ui";
@ -38,8 +39,6 @@ import { EventTeamWebhooksTab } from "@components/eventtype/EventTeamWebhooksTab
import { EventTypeSingleLayout } from "@components/eventtype/EventTypeSingleLayout"; import { EventTypeSingleLayout } from "@components/eventtype/EventTypeSingleLayout";
import EventWorkflowsTab from "@components/eventtype/EventWorkfowsTab"; import EventWorkflowsTab from "@components/eventtype/EventWorkfowsTab";
import { ssrInit } from "@server/lib/ssr";
export type FormValues = { export type FormValues = {
title: string; title: string;
eventTitle: string; eventTitle: string;

View File

@ -12,6 +12,7 @@ import Shell from "@calcom/features/shell/Shell";
import { APP_NAME, CAL_URL, WEBAPP_URL } from "@calcom/lib/constants"; import { APP_NAME, CAL_URL, WEBAPP_URL } from "@calcom/lib/constants";
import { useLocale } from "@calcom/lib/hooks/useLocale"; import { useLocale } from "@calcom/lib/hooks/useLocale";
import { RouterOutputs, trpc, TRPCClientError } from "@calcom/trpc/react"; import { RouterOutputs, trpc, TRPCClientError } from "@calcom/trpc/react";
import { ssrInit } from "@calcom/trpc/server/ssr";
import { import {
Badge, Badge,
Button, Button,
@ -40,8 +41,6 @@ import { HttpError } from "@lib/core/http/error";
import { EmbedButton, EmbedDialog } from "@components/Embed"; import { EmbedButton, EmbedDialog } from "@components/Embed";
import SkeletonLoader from "@components/eventtype/SkeletonLoader"; import SkeletonLoader from "@components/eventtype/SkeletonLoader";
import { ssrInit } from "@server/lib/ssr";
type EventTypeGroups = RouterOutputs["viewer"]["eventTypes"]["getByViewer"]["eventTypeGroups"]; type EventTypeGroups = RouterOutputs["viewer"]["eventTypes"]["getByViewer"]["eventTypeGroups"];
type EventTypeGroupProfile = EventTypeGroups[number]["profile"]; type EventTypeGroupProfile = EventTypeGroups[number]["profile"];

View File

@ -4,7 +4,7 @@ import Head from "next/head";
import { useRouter } from "next/router"; import { useRouter } from "next/router";
import { z } from "zod"; import { z } from "zod";
import { getSession } from "@calcom/lib/auth"; import { getSession } from "@calcom/features/auth/lib";
import { APP_NAME } from "@calcom/lib/constants"; import { APP_NAME } from "@calcom/lib/constants";
import { useLocale } from "@calcom/lib/hooks/useLocale"; import { useLocale } from "@calcom/lib/hooks/useLocale";
import { User } from "@calcom/prisma/client"; import { User } from "@calcom/prisma/client";

View File

@ -2,12 +2,11 @@ import { GetServerSidePropsContext } from "next";
import AdminAppsList from "@calcom/features/apps/AdminAppsList"; import AdminAppsList from "@calcom/features/apps/AdminAppsList";
import { useLocale } from "@calcom/lib/hooks/useLocale"; import { useLocale } from "@calcom/lib/hooks/useLocale";
import { ssrInit } from "@calcom/trpc/server/ssr";
import { Meta } from "@calcom/ui"; import { Meta } from "@calcom/ui";
import { getLayout } from "@components/auth/layouts/AdminLayout"; import { getLayout } from "@components/auth/layouts/AdminLayout";
import { ssrInit } from "@server/lib/ssr";
function AdminAppsView() { function AdminAppsView() {
const { t } = useLocale(); const { t } = useLocale();
return ( return (

View File

@ -3,12 +3,11 @@ import { signIn } from "next-auth/react";
import { useRef } from "react"; import { useRef } from "react";
import { useLocale } from "@calcom/lib/hooks/useLocale"; import { useLocale } from "@calcom/lib/hooks/useLocale";
import { ssrInit } from "@calcom/trpc/server/ssr";
import { Button, Meta, TextField } from "@calcom/ui"; import { Button, Meta, TextField } from "@calcom/ui";
import { getLayout } from "@components/auth/layouts/AdminLayout"; import { getLayout } from "@components/auth/layouts/AdminLayout";
import { ssrInit } from "@server/lib/ssr";
function AdminView() { function AdminView() {
const { t } = useLocale(); const { t } = useLocale();
const usernameRef = useRef<HTMLInputElement>(null); const usernameRef = useRef<HTMLInputElement>(null);

View File

@ -1,11 +1,10 @@
import { GetServerSidePropsContext } from "next"; import { GetServerSidePropsContext } from "next";
import { ssrInit } from "@calcom/trpc/server/ssr";
import { Meta } from "@calcom/ui"; import { Meta } from "@calcom/ui";
import { getLayout } from "@components/auth/layouts/AdminLayout"; import { getLayout } from "@components/auth/layouts/AdminLayout";
import { ssrInit } from "@server/lib/ssr";
function AdminAppsView() { function AdminAppsView() {
return ( return (
<> <>

View File

@ -1,12 +1,11 @@
import { GetServerSidePropsContext } from "next"; import { GetServerSidePropsContext } from "next";
import { useLocale } from "@calcom/lib/hooks/useLocale"; import { useLocale } from "@calcom/lib/hooks/useLocale";
import { ssrInit } from "@calcom/trpc/server/ssr";
import { Meta } from "@calcom/ui"; import { Meta } from "@calcom/ui";
import { getLayout } from "@components/auth/layouts/AdminLayout"; import { getLayout } from "@components/auth/layouts/AdminLayout";
import { ssrInit } from "@server/lib/ssr";
function AdminUsersView() { function AdminUsersView() {
const { t } = useLocale(); const { t } = useLocale();
return ( return (

View File

@ -8,10 +8,9 @@ import { classNames } from "@calcom/lib";
import { WEBAPP_URL } from "@calcom/lib/constants"; import { WEBAPP_URL } from "@calcom/lib/constants";
import { useLocale } from "@calcom/lib/hooks/useLocale"; import { useLocale } from "@calcom/lib/hooks/useLocale";
import { trpc } from "@calcom/trpc/react"; import { trpc } from "@calcom/trpc/react";
import { ssrInit } from "@calcom/trpc/server/ssr";
import { Button, Icon, Meta } from "@calcom/ui"; import { Button, Icon, Meta } from "@calcom/ui";
import { ssrInit } from "@server/lib/ssr";
interface CtaRowProps { interface CtaRowProps {
title: string; title: string;
description: string; description: string;

View File

@ -9,6 +9,7 @@ import { getLayout } from "@calcom/features/settings/layouts/SettingsLayout";
import { APP_NAME } from "@calcom/lib/constants"; import { APP_NAME } from "@calcom/lib/constants";
import { useLocale } from "@calcom/lib/hooks/useLocale"; import { useLocale } from "@calcom/lib/hooks/useLocale";
import { trpc } from "@calcom/trpc/react"; import { trpc } from "@calcom/trpc/react";
import { ssrInit } from "@calcom/trpc/server/ssr";
import { import {
Button, Button,
Dialog, Dialog,
@ -19,8 +20,6 @@ import {
AppSkeletonLoader as SkeletonLoader, AppSkeletonLoader as SkeletonLoader,
} from "@calcom/ui"; } from "@calcom/ui";
import { ssrInit } from "@server/lib/ssr";
const ApiKeysView = () => { const ApiKeysView = () => {
const { t } = useLocale(); const { t } = useLocale();

View File

@ -6,6 +6,7 @@ import { getLayout } from "@calcom/features/settings/layouts/SettingsLayout";
import { APP_NAME } from "@calcom/lib/constants"; import { APP_NAME } from "@calcom/lib/constants";
import { useLocale } from "@calcom/lib/hooks/useLocale"; import { useLocale } from "@calcom/lib/hooks/useLocale";
import { trpc } from "@calcom/trpc/react"; import { trpc } from "@calcom/trpc/react";
import { ssrInit } from "@calcom/trpc/server/ssr";
import { import {
Button, Button,
ColorPicker, ColorPicker,
@ -19,8 +20,6 @@ import {
UpgradeTeamsBadge, UpgradeTeamsBadge,
} from "@calcom/ui"; } from "@calcom/ui";
import { ssrInit } from "@server/lib/ssr";
const SkeletonLoader = ({ title, description }: { title: string; description: string }) => { const SkeletonLoader = ({ title, description }: { title: string; description: string }) => {
return ( return (
<SkeletonContainer> <SkeletonContainer>

View File

@ -9,6 +9,7 @@ import DestinationCalendarSelector from "@calcom/features/calendars/DestinationC
import { getLayout } from "@calcom/features/settings/layouts/SettingsLayout"; import { getLayout } from "@calcom/features/settings/layouts/SettingsLayout";
import { useLocale } from "@calcom/lib/hooks/useLocale"; import { useLocale } from "@calcom/lib/hooks/useLocale";
import { trpc } from "@calcom/trpc/react"; import { trpc } from "@calcom/trpc/react";
import { ssrInit } from "@calcom/trpc/server/ssr";
import { import {
Alert, Alert,
Badge, Badge,
@ -30,8 +31,6 @@ import { QueryCell } from "@lib/QueryCell";
import { CalendarSwitch } from "@components/settings/CalendarSwitch"; import { CalendarSwitch } from "@components/settings/CalendarSwitch";
import { ssrInit } from "@server/lib/ssr";
const SkeletonLoader = () => { const SkeletonLoader = () => {
return ( return (
<SkeletonContainer> <SkeletonContainer>

View File

@ -4,6 +4,7 @@ import { useState } from "react";
import { getLayout } from "@calcom/features/settings/layouts/SettingsLayout"; import { getLayout } from "@calcom/features/settings/layouts/SettingsLayout";
import { useLocale } from "@calcom/lib/hooks/useLocale"; import { useLocale } from "@calcom/lib/hooks/useLocale";
import { trpc } from "@calcom/trpc/react"; import { trpc } from "@calcom/trpc/react";
import { ssrInit } from "@calcom/trpc/server/ssr";
import { import {
Button, Button,
Dialog, Dialog,
@ -25,8 +26,6 @@ import {
import AppListCard from "@components/AppListCard"; import AppListCard from "@components/AppListCard";
import { ssrInit } from "@server/lib/ssr";
const SkeletonLoader = ({ title, description }: { title: string; description: string }) => { const SkeletonLoader = ({ title, description }: { title: string; description: string }) => {
return ( return (
<SkeletonContainer> <SkeletonContainer>

View File

@ -6,6 +6,7 @@ import { Controller, useForm } from "react-hook-form";
import { getLayout } from "@calcom/features/settings/layouts/SettingsLayout"; import { getLayout } from "@calcom/features/settings/layouts/SettingsLayout";
import { useLocale } from "@calcom/lib/hooks/useLocale"; import { useLocale } from "@calcom/lib/hooks/useLocale";
import { RouterOutputs, trpc } from "@calcom/trpc/react"; import { RouterOutputs, trpc } from "@calcom/trpc/react";
import { ssrInit } from "@calcom/trpc/server/ssr";
import { import {
Button, Button,
Form, Form,
@ -22,8 +23,6 @@ import {
import { withQuery } from "@lib/QueryCell"; import { withQuery } from "@lib/QueryCell";
import { nameOfDay } from "@lib/core/i18n/weekday"; import { nameOfDay } from "@lib/core/i18n/weekday";
import { ssrInit } from "@server/lib/ssr";
const SkeletonLoader = ({ title, description }: { title: string; description: string }) => { const SkeletonLoader = ({ title, description }: { title: string; description: string }) => {
return ( return (
<SkeletonContainer> <SkeletonContainer>

View File

@ -5,13 +5,14 @@ import { signOut } from "next-auth/react";
import { BaseSyntheticEvent, useRef, useState } from "react"; import { BaseSyntheticEvent, useRef, useState } from "react";
import { Controller, useForm } from "react-hook-form"; import { Controller, useForm } from "react-hook-form";
import { ErrorCode } from "@calcom/features/auth/lib";
import { getLayout } from "@calcom/features/settings/layouts/SettingsLayout"; import { getLayout } from "@calcom/features/settings/layouts/SettingsLayout";
import { ErrorCode } from "@calcom/lib/auth";
import { APP_NAME } from "@calcom/lib/constants"; import { APP_NAME } from "@calcom/lib/constants";
import { useLocale } from "@calcom/lib/hooks/useLocale"; import { useLocale } from "@calcom/lib/hooks/useLocale";
import { TRPCClientErrorLike } from "@calcom/trpc/client"; import { TRPCClientErrorLike } from "@calcom/trpc/client";
import { trpc } from "@calcom/trpc/react"; import { trpc } from "@calcom/trpc/react";
import { AppRouter } from "@calcom/trpc/server/routers/_app"; import { AppRouter } from "@calcom/trpc/server/routers/_app";
import { ssrInit } from "@calcom/trpc/server/ssr";
import { import {
Alert, Alert,
Avatar, Avatar,
@ -38,8 +39,6 @@ import {
import TwoFactor from "@components/auth/TwoFactor"; import TwoFactor from "@components/auth/TwoFactor";
import { UsernameAvailabilityField } from "@components/ui/UsernameAvailability"; import { UsernameAvailabilityField } from "@components/ui/UsernameAvailability";
import { ssrInit } from "@server/lib/ssr";
const SkeletonLoader = ({ title, description }: { title: string; description: string }) => { const SkeletonLoader = ({ title, description }: { title: string; description: string }) => {
return ( return (
<SkeletonContainer> <SkeletonContainer>

View File

@ -4,10 +4,9 @@ import { useForm } from "react-hook-form";
import { getLayout } from "@calcom/features/settings/layouts/SettingsLayout"; import { getLayout } from "@calcom/features/settings/layouts/SettingsLayout";
import { useLocale } from "@calcom/lib/hooks/useLocale"; import { useLocale } from "@calcom/lib/hooks/useLocale";
import { trpc } from "@calcom/trpc/react"; import { trpc } from "@calcom/trpc/react";
import { ssrInit } from "@calcom/trpc/server/ssr";
import { Button, Form, Label, Meta, showToast, Skeleton, Switch } from "@calcom/ui"; import { Button, Form, Label, Meta, showToast, Skeleton, Switch } from "@calcom/ui";
import { ssrInit } from "@server/lib/ssr";
const ProfileImpersonationView = () => { const ProfileImpersonationView = () => {
const { t } = useLocale(); const { t } = useLocale();
const utils = trpc.useContext(); const utils = trpc.useContext();

View File

@ -3,14 +3,13 @@ import { GetServerSidePropsContext } from "next";
import { Trans } from "next-i18next"; import { Trans } from "next-i18next";
import { useForm } from "react-hook-form"; import { useForm } from "react-hook-form";
import { identityProviderNameMap } from "@calcom/features/auth/lib";
import { getLayout } from "@calcom/features/settings/layouts/SettingsLayout"; import { getLayout } from "@calcom/features/settings/layouts/SettingsLayout";
import { identityProviderNameMap } from "@calcom/lib/auth";
import { useLocale } from "@calcom/lib/hooks/useLocale"; import { useLocale } from "@calcom/lib/hooks/useLocale";
import { trpc } from "@calcom/trpc/react"; import { trpc } from "@calcom/trpc/react";
import { ssrInit } from "@calcom/trpc/server/ssr";
import { Button, Form, Meta, PasswordField, showToast } from "@calcom/ui"; import { Button, Form, Meta, PasswordField, showToast } from "@calcom/ui";
import { ssrInit } from "@server/lib/ssr";
type ChangePasswordFormValues = { type ChangePasswordFormValues = {
oldPassword: string; oldPassword: string;
newPassword: string; newPassword: string;

View File

@ -1,6 +1,6 @@
import { GetServerSidePropsContext } from "next"; import { GetServerSidePropsContext } from "next";
import { ssrInit } from "@server/lib/ssr"; import { ssrInit } from "@calcom/trpc/server/ssr";
export { default } from "@calcom/features/ee/sso/page/user-sso-view"; export { default } from "@calcom/features/ee/sso/page/user-sso-view";

View File

@ -4,13 +4,12 @@ import { useState } from "react";
import { getLayout } from "@calcom/features/settings/layouts/SettingsLayout"; import { getLayout } from "@calcom/features/settings/layouts/SettingsLayout";
import { useLocale } from "@calcom/lib/hooks/useLocale"; import { useLocale } from "@calcom/lib/hooks/useLocale";
import { trpc } from "@calcom/trpc/react"; import { trpc } from "@calcom/trpc/react";
import { ssrInit } from "@calcom/trpc/server/ssr";
import { Badge, Meta, Switch, SkeletonButton, SkeletonContainer, SkeletonText } from "@calcom/ui"; import { Badge, Meta, Switch, SkeletonButton, SkeletonContainer, SkeletonText } from "@calcom/ui";
import DisableTwoFactorModal from "@components/settings/DisableTwoFactorModal"; import DisableTwoFactorModal from "@components/settings/DisableTwoFactorModal";
import EnableTwoFactorModal from "@components/settings/EnableTwoFactorModal"; import EnableTwoFactorModal from "@components/settings/EnableTwoFactorModal";
import { ssrInit } from "@server/lib/ssr";
const SkeletonLoader = () => { const SkeletonLoader = () => {
return ( return (
<SkeletonContainer> <SkeletonContainer>

View File

@ -1,6 +1,6 @@
import { GetServerSidePropsContext } from "next"; import { GetServerSidePropsContext } from "next";
import { ssrInit } from "@server/lib/ssr"; import { ssrInit } from "@calcom/trpc/server/ssr";
export { default } from "@calcom/features/ee/teams/pages/team-appearance-view"; export { default } from "@calcom/features/ee/teams/pages/team-appearance-view";

View File

@ -1,6 +1,6 @@
import { GetServerSidePropsContext } from "next"; import { GetServerSidePropsContext } from "next";
import { ssrInit } from "@server/lib/ssr"; import { ssrInit } from "@calcom/trpc/server/ssr";
export { default } from "@calcom/features/ee/teams/pages/team-billing-view"; export { default } from "@calcom/features/ee/teams/pages/team-billing-view";

View File

@ -1,6 +1,6 @@
import { GetServerSidePropsContext } from "next"; import { GetServerSidePropsContext } from "next";
import { ssrInit } from "@server/lib/ssr"; import { ssrInit } from "@calcom/trpc/server/ssr";
export { default } from "@calcom/features/ee/teams/pages/team-members-view"; export { default } from "@calcom/features/ee/teams/pages/team-members-view";

View File

@ -1,6 +1,6 @@
import { GetServerSidePropsContext } from "next"; import { GetServerSidePropsContext } from "next";
import { ssrInit } from "@server/lib/ssr"; import { ssrInit } from "@calcom/trpc/server/ssr";
export { default } from "@calcom/features/ee/teams/pages/team-profile-view"; export { default } from "@calcom/features/ee/teams/pages/team-profile-view";

View File

@ -1,6 +1,6 @@
import { GetServerSidePropsContext } from "next"; import { GetServerSidePropsContext } from "next";
import { ssrInit } from "@server/lib/ssr"; import { ssrInit } from "@calcom/trpc/server/ssr";
export { default } from "@calcom/features/ee/sso/page/teams-sso-view"; export { default } from "@calcom/features/ee/sso/page/teams-sso-view";

View File

@ -3,11 +3,10 @@ import Head from "next/head";
import { CreateANewTeamForm } from "@calcom/features/ee/teams/components"; import { CreateANewTeamForm } from "@calcom/features/ee/teams/components";
import { useLocale } from "@calcom/lib/hooks/useLocale"; import { useLocale } from "@calcom/lib/hooks/useLocale";
import { ssrInit } from "@calcom/trpc/server/ssr";
import { getLayout } from "@components/layouts/WizardLayout"; import { getLayout } from "@components/layouts/WizardLayout";
import { ssrInit } from "@server/lib/ssr";
const CreateNewTeamPage = () => { const CreateNewTeamPage = () => {
const { t } = useLocale(); const { t } = useLocale();
return ( return (

View File

@ -7,13 +7,13 @@ import LicenseRequired from "@calcom/features/ee/common/components/v2/LicenseReq
import { isSAMLLoginEnabled } from "@calcom/features/ee/sso/lib/saml"; import { isSAMLLoginEnabled } from "@calcom/features/ee/sso/lib/saml";
import { useLocale } from "@calcom/lib/hooks/useLocale"; import { useLocale } from "@calcom/lib/hooks/useLocale";
import { collectPageParameters, telemetryEventTypes, useTelemetry } from "@calcom/lib/telemetry"; import { collectPageParameters, telemetryEventTypes, useTelemetry } from "@calcom/lib/telemetry";
import { ssrInit } from "@calcom/trpc/server/ssr";
import { inferSSRProps } from "@calcom/types/inferSSRProps"; import { inferSSRProps } from "@calcom/types/inferSSRProps";
import { Alert, Button, EmailField, PasswordField, TextField, HeadSeo } from "@calcom/ui"; import { Alert, Button, EmailField, PasswordField, TextField, HeadSeo } from "@calcom/ui";
import { asStringOrNull } from "@calcom/web/lib/asStringOrNull"; import { asStringOrNull } from "@calcom/web/lib/asStringOrNull";
import { WEBAPP_URL } from "@calcom/web/lib/config/constants"; import { WEBAPP_URL } from "@calcom/web/lib/config/constants";
import prisma from "@calcom/web/lib/prisma"; import prisma from "@calcom/web/lib/prisma";
import { IS_GOOGLE_LOGIN_ENABLED } from "@calcom/web/server/lib/constants"; import { IS_GOOGLE_LOGIN_ENABLED } from "@calcom/web/server/lib/constants";
import { ssrInit } from "@calcom/web/server/lib/ssr";
type FormValues = { type FormValues = {
username: string; username: string;

View File

@ -4,6 +4,7 @@ import { privacyFilteredLocations, LocationObject } from "@calcom/core/location"
import { parseRecurringEvent } from "@calcom/lib"; import { parseRecurringEvent } from "@calcom/lib";
import prisma from "@calcom/prisma"; import prisma from "@calcom/prisma";
import { EventTypeMetaDataSchema } from "@calcom/prisma/zod-utils"; import { EventTypeMetaDataSchema } from "@calcom/prisma/zod-utils";
import { ssgInit } from "@calcom/trpc/server/ssg";
import { asStringOrNull } from "@lib/asStringOrNull"; import { asStringOrNull } from "@lib/asStringOrNull";
import { getWorkingHours } from "@lib/availability"; import { getWorkingHours } from "@lib/availability";
@ -13,8 +14,6 @@ import { EmbedProps } from "@lib/withEmbedSsr";
import AvailabilityPage from "@components/booking/pages/AvailabilityPage"; import AvailabilityPage from "@components/booking/pages/AvailabilityPage";
import { ssgInit } from "@server/lib/ssg";
export type AvailabilityTeamPageProps = inferSSRProps<typeof getServerSideProps> & EmbedProps; export type AvailabilityTeamPageProps = inferSSRProps<typeof getServerSideProps> & EmbedProps;
export default function TeamType(props: AvailabilityTeamPageProps) { export default function TeamType(props: AvailabilityTeamPageProps) {

View File

@ -4,10 +4,9 @@ import { TeamsListing } from "@calcom/features/ee/teams/components";
import Shell from "@calcom/features/shell/Shell"; import Shell from "@calcom/features/shell/Shell";
import { WEBAPP_URL } from "@calcom/lib/constants"; import { WEBAPP_URL } from "@calcom/lib/constants";
import { useLocale } from "@calcom/lib/hooks/useLocale"; import { useLocale } from "@calcom/lib/hooks/useLocale";
import { ssrInit } from "@calcom/trpc/server/ssr";
import { Button, Icon } from "@calcom/ui"; import { Button, Icon } from "@calcom/ui";
import { ssrInit } from "@server/lib/ssr";
function Teams() { function Teams() {
const { t } = useLocale(); const { t } = useLocale();
return ( return (

View File

@ -1,6 +1,6 @@
import { GetServerSidePropsContext } from "next"; import { GetServerSidePropsContext } from "next";
import { ssrInit } from "@server/lib/ssr"; import { ssrInit } from "@calcom/trpc/server/ssr";
export { default } from "@calcom/features/ee/workflows/pages/index"; export { default } from "@calcom/features/ee/workflows/pages/index";

View File

@ -33,6 +33,7 @@
"dev:console": "turbo run dev --scope=\"@calcom/web\" --scope=\"@calcom/console\"", "dev:console": "turbo run dev --scope=\"@calcom/web\" --scope=\"@calcom/console\"",
"dev:swagger": "turbo run dev --scope=\"@calcom/api\" --scope=\"@calcom/swagger\"", "dev:swagger": "turbo run dev --scope=\"@calcom/api\" --scope=\"@calcom/swagger\"",
"dev:website": "turbo run dev --scope=\"@calcom/web\" --scope=\"@calcom/website\"", "dev:website": "turbo run dev --scope=\"@calcom/web\" --scope=\"@calcom/website\"",
"dev:auth": "turbo run dev --scope=\"@calcom/web\" --scope=\"@calcom/auth\"",
"dev": "turbo run dev --scope=\"@calcom/web\"", "dev": "turbo run dev --scope=\"@calcom/web\"",
"docs-build": "turbo run build --scope=\"@calcom/docs\" --include-dependencies", "docs-build": "turbo run build --scope=\"@calcom/docs\" --include-dependencies",
"docs-dev": "turbo run dev --scope=\"@calcom/docs\"", "docs-dev": "turbo run dev --scope=\"@calcom/docs\"",

View File

@ -1,6 +1,14 @@
import z from "zod"; import z from "zod";
import { InstalledAppVariants } from "../utils"; const InstalledAppVariants = [
"conferencing",
"calendar",
"payment",
"analytics",
"automation",
"other",
"web3",
] as const;
const variantSchema = z.enum(InstalledAppVariants); const variantSchema = z.enum(InstalledAppVariants);

View File

@ -7,9 +7,7 @@
"logo": "icon.svg", "logo": "icon.svg",
"url": "https://example.com/link", "url": "https://example.com/link",
"variant": "other", "variant": "other",
"categories": [ "categories": ["other"],
"other"
],
"publisher": "Cal.com, Inc.", "publisher": "Cal.com, Inc.",
"email": "support@cal.com", "email": "support@cal.com",
"description": "It is a template for an app that can be installed and provides no other feature.", "description": "It is a template for an app that can be installed and provides no other feature.",

View File

@ -6,6 +6,7 @@
"license": "MIT", "license": "MIT",
"files": [ "files": [
"eslint-preset.js", "eslint-preset.js",
"next-i18next.config.js",
"prettier-preset.js" "prettier-preset.js"
], ],
"dependencies": { "dependencies": {

View File

@ -1,12 +1,9 @@
import { IdentityProvider } from "@prisma/client"; import { IdentityProvider } from "@prisma/client";
import type { NextApiRequest, NextApiResponse } from "next"; import type { NextApiRequest, NextApiResponse } from "next";
import { getSession, ErrorCode, hashPassword, verifyPassword } from "@calcom/features/auth/lib";
import prisma from "@calcom/prisma"; import prisma from "@calcom/prisma";
import { getSession } from "@lib/auth";
import { ErrorCode, hashPassword, verifyPassword } from "../../../lib/auth";
export default async function handler(req: NextApiRequest, res: NextApiResponse) { export default async function handler(req: NextApiRequest, res: NextApiResponse) {
const session = await getSession({ req: req }); const session = await getSession({ req: req });

View File

@ -4,10 +4,9 @@ import { NextApiRequest, NextApiResponse } from "next";
import dayjs from "@calcom/dayjs"; import dayjs from "@calcom/dayjs";
import { sendPasswordResetEmail } from "@calcom/emails"; import { sendPasswordResetEmail } from "@calcom/emails";
import { PASSWORD_RESET_EXPIRY_HOURS } from "@calcom/emails/templates/forgot-password-email"; import { PASSWORD_RESET_EXPIRY_HOURS } from "@calcom/emails/templates/forgot-password-email";
import { getTranslation } from "@calcom/lib/server/i18n";
import prisma from "@calcom/prisma"; import prisma from "@calcom/prisma";
import { getTranslation } from "@server/lib/i18n";
export default async function handler(req: NextApiRequest, res: NextApiResponse) { export default async function handler(req: NextApiRequest, res: NextApiResponse) {
const t = await getTranslation(req.body.language ?? "en", "common"); const t = await getTranslation(req.body.language ?? "en", "common");

View File

@ -10,23 +10,29 @@ import nodemailer, { TransportOptions } from "nodemailer";
import { authenticator } from "otplib"; import { authenticator } from "otplib";
import path from "path"; import path from "path";
import { ErrorCode, isPasswordValid, verifyPassword } from "@calcom/features/auth/lib";
import CalComAdapter from "@calcom/features/auth/lib/next-auth-custom-adapter";
import checkLicense from "@calcom/features/ee/common/server/checkLicense"; import checkLicense from "@calcom/features/ee/common/server/checkLicense";
import ImpersonationProvider from "@calcom/features/ee/impersonation/lib/ImpersonationProvider"; import ImpersonationProvider from "@calcom/features/ee/impersonation/lib/ImpersonationProvider";
import { hostedCal, isSAMLLoginEnabled } from "@calcom/features/ee/sso/lib/saml"; import { hostedCal, isSAMLLoginEnabled } from "@calcom/features/ee/sso/lib/saml";
import { ErrorCode, isPasswordValid, verifyPassword } from "@calcom/lib/auth";
import { APP_NAME, IS_TEAM_BILLING_ENABLED, WEBAPP_URL } from "@calcom/lib/constants"; import { APP_NAME, IS_TEAM_BILLING_ENABLED, WEBAPP_URL } from "@calcom/lib/constants";
import { symmetricDecrypt } from "@calcom/lib/crypto"; import { symmetricDecrypt } from "@calcom/lib/crypto";
import { defaultCookies } from "@calcom/lib/default-cookies"; import { defaultCookies } from "@calcom/lib/default-cookies";
import { randomString } from "@calcom/lib/random";
import rateLimit from "@calcom/lib/rateLimit"; import rateLimit from "@calcom/lib/rateLimit";
import { serverConfig } from "@calcom/lib/serverConfig"; import { serverConfig } from "@calcom/lib/serverConfig";
import slugify from "@calcom/lib/slugify";
import prisma from "@calcom/prisma"; import prisma from "@calcom/prisma";
import { teamMetadataSchema } from "@calcom/prisma/zod-utils"; import { teamMetadataSchema } from "@calcom/prisma/zod-utils";
import CalComAdapter from "@lib/auth/next-auth-custom-adapter"; const GOOGLE_API_CREDENTIALS = process.env.GOOGLE_API_CREDENTIALS || "{}";
import { randomString } from "@lib/random"; const { client_id: GOOGLE_CLIENT_ID, client_secret: GOOGLE_CLIENT_SECRET } =
import slugify from "@lib/slugify"; JSON.parse(GOOGLE_API_CREDENTIALS)?.web || {};
const GOOGLE_LOGIN_ENABLED = process.env.GOOGLE_LOGIN_ENABLED === "true";
const IS_GOOGLE_LOGIN_ENABLED = !!(GOOGLE_CLIENT_ID && GOOGLE_CLIENT_SECRET && GOOGLE_LOGIN_ENABLED);
const IS_SAML_LOGIN_ENABLED = !!(process.env.SAML_DATABASE_URL && process.env.SAML_ADMINS);
import { GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, IS_GOOGLE_LOGIN_ENABLED } from "@server/lib/constants"; const NEXTAUTH_URL = process.env.NEXTAUTH_URL || WEBAPP_URL;
const transporter = nodemailer.createTransport<TransportOptions>({ const transporter = nodemailer.createTransport<TransportOptions>({
...(serverConfig.transport as TransportOptions), ...(serverConfig.transport as TransportOptions),
@ -173,7 +179,7 @@ if (isSAMLLoginEnabled) {
version: "2.0", version: "2.0",
checks: ["pkce", "state"], checks: ["pkce", "state"],
authorization: { authorization: {
url: `${WEBAPP_URL}/api/auth/saml/authorize`, url: `${NEXTAUTH_URL}/api/auth/saml/authorize`,
params: { params: {
scope: "", scope: "",
response_type: "code", response_type: "code",
@ -181,10 +187,10 @@ if (isSAMLLoginEnabled) {
}, },
}, },
token: { token: {
url: `${WEBAPP_URL}/api/auth/saml/token`, url: `${NEXTAUTH_URL}/api/auth/saml/token`,
params: { grant_type: "authorization_code" }, params: { grant_type: "authorization_code" },
}, },
userinfo: `${WEBAPP_URL}/api/auth/saml/userinfo`, userinfo: `${NEXTAUTH_URL}/api/auth/saml/userinfo`,
profile: (profile) => { profile: (profile) => {
return { return {
id: profile.id || "", id: profile.id || "",
@ -211,7 +217,7 @@ if (true) {
// Here we setup the sendVerificationRequest that calls the email template with the identifier (email) and token to verify. // Here we setup the sendVerificationRequest that calls the email template with the identifier (email) and token to verify.
sendVerificationRequest: ({ identifier, url }) => { sendVerificationRequest: ({ identifier, url }) => {
const originalUrl = new URL(url); const originalUrl = new URL(url);
const webappUrl = new URL(WEBAPP_URL); const webappUrl = new URL(NEXTAUTH_URL);
if (originalUrl.origin !== webappUrl.origin) { if (originalUrl.origin !== webappUrl.origin) {
url = url.replace(originalUrl.origin, webappUrl.origin); url = url.replace(originalUrl.origin, webappUrl.origin);
} }
@ -224,7 +230,7 @@ if (true) {
to: identifier, to: identifier,
subject: "Your sign-in link for " + APP_NAME, subject: "Your sign-in link for " + APP_NAME,
html: emailTemplate({ html: emailTemplate({
base_url: WEBAPP_URL, base_url: NEXTAUTH_URL,
signin_url: url, signin_url: url,
email: identifier, email: identifier,
}), }),
@ -241,7 +247,7 @@ export default NextAuth({
session: { session: {
strategy: "jwt", strategy: "jwt",
}, },
cookies: defaultCookies(WEBAPP_URL?.startsWith("https://")), cookies: defaultCookies(NEXTAUTH_URL?.startsWith("https://")),
pages: { pages: {
signIn: "/auth/login", signIn: "/auth/login",
signOut: "/auth/logout", signOut: "/auth/logout",
@ -499,7 +505,7 @@ export default NextAuth({
// Allows relative callback URLs // Allows relative callback URLs
if (url.startsWith("/")) return `${baseUrl}${url}`; if (url.startsWith("/")) return `${baseUrl}${url}`;
// Allows callback URLs on the same domain // Allows callback URLs on the same domain
else if (new URL(url).hostname === new URL(WEBAPP_URL).hostname) return url; else if (new URL(url).hostname === new URL(NEXTAUTH_URL).hostname) return url;
return baseUrl; return baseUrl;
}, },
}, },

View File

@ -1,9 +1,8 @@
import { NextApiRequest, NextApiResponse } from "next"; import { NextApiRequest, NextApiResponse } from "next";
import { hashPassword } from "@calcom/features/auth/lib";
import prisma from "@calcom/prisma"; import prisma from "@calcom/prisma";
import { hashPassword } from "@lib/auth";
export default async function handler(req: NextApiRequest, res: NextApiResponse) { export default async function handler(req: NextApiRequest, res: NextApiResponse) {
if (req.method !== "POST") { if (req.method !== "POST") {
return res.status(400).json({ message: "" }); return res.status(400).json({ message: "" });

View File

@ -2,8 +2,7 @@ import { OAuthReq } from "@boxyhq/saml-jackson";
import { NextApiRequest, NextApiResponse } from "next"; import { NextApiRequest, NextApiResponse } from "next";
import jackson from "@calcom/features/ee/sso/lib/jackson"; import jackson from "@calcom/features/ee/sso/lib/jackson";
import { HttpError } from "@calcom/lib/http-error";
import { HttpError } from "@lib/core/http/error";
export default async function handler(req: NextApiRequest, res: NextApiResponse) { export default async function handler(req: NextApiRequest, res: NextApiResponse) {
const { oauthController } = await jackson(); const { oauthController } = await jackson();

View File

@ -1,9 +1,8 @@
import { IdentityProvider } from "@prisma/client"; import { IdentityProvider } from "@prisma/client";
import { NextApiRequest, NextApiResponse } from "next"; import { NextApiRequest } from "next";
import z from "zod"; import z from "zod";
import { isPasswordValid } from "@calcom/lib/auth"; import { hashPassword, isPasswordValid } from "@calcom/features/auth/lib";
import { hashPassword } from "@calcom/lib/auth";
import { HttpError } from "@calcom/lib/http-error"; import { HttpError } from "@calcom/lib/http-error";
import { defaultHandler, defaultResponder } from "@calcom/lib/server"; import { defaultHandler, defaultResponder } from "@calcom/lib/server";
import slugify from "@calcom/lib/slugify"; import slugify from "@calcom/lib/slugify";

View File

@ -1,22 +1,16 @@
import { IdentityProvider } from "@prisma/client"; import { IdentityProvider } from "@prisma/client";
import { NextApiRequest, NextApiResponse } from "next"; import { NextApiRequest, NextApiResponse } from "next";
import { hashPassword } from "@calcom/lib/auth"; import { hashPassword } from "@calcom/features/auth/lib";
import slugify from "@calcom/lib/slugify";
import { closeComUpsertTeamUser } from "@calcom/lib/sync/SyncServiceManager"; import { closeComUpsertTeamUser } from "@calcom/lib/sync/SyncServiceManager";
import prisma from "@calcom/prisma"; import prisma from "@calcom/prisma";
import slugify from "@lib/slugify";
export default async function handler(req: NextApiRequest, res: NextApiResponse) { export default async function handler(req: NextApiRequest, res: NextApiResponse) {
if (req.method !== "POST") { if (req.method !== "POST") {
return; return;
} }
if (process.env.NEXT_PUBLIC_DISABLE_SIGNUP === "true") {
res.status(403).json({ message: "Signup is disabled" });
return;
}
const data = req.body; const data = req.body;
const { email, password } = data; const { email, password } = data;
const username = slugify(data.username); const username = slugify(data.username);

View File

@ -1,11 +1,10 @@
import { NextApiRequest, NextApiResponse } from "next"; import { NextApiRequest, NextApiResponse } from "next";
import { authenticator } from "otplib"; import { authenticator } from "otplib";
import { ErrorCode, getSession, verifyPassword } from "@calcom/features/auth/lib";
import { symmetricDecrypt } from "@calcom/lib/crypto"; import { symmetricDecrypt } from "@calcom/lib/crypto";
import prisma from "@calcom/prisma"; import prisma from "@calcom/prisma";
import { ErrorCode, getSession, verifyPassword } from "@lib/auth";
export default async function handler(req: NextApiRequest, res: NextApiResponse) { export default async function handler(req: NextApiRequest, res: NextApiResponse) {
if (req.method !== "POST") { if (req.method !== "POST") {
return res.status(405).json({ message: "Method not allowed" }); return res.status(405).json({ message: "Method not allowed" });

View File

@ -1,11 +1,10 @@
import { NextApiRequest, NextApiResponse } from "next"; import { NextApiRequest, NextApiResponse } from "next";
import { authenticator } from "otplib"; import { authenticator } from "otplib";
import { ErrorCode, getSession } from "@calcom/features/auth/lib";
import { symmetricDecrypt } from "@calcom/lib/crypto"; import { symmetricDecrypt } from "@calcom/lib/crypto";
import prisma from "@calcom/prisma"; import prisma from "@calcom/prisma";
import { ErrorCode, getSession } from "@lib/auth";
export default async function handler(req: NextApiRequest, res: NextApiResponse) { export default async function handler(req: NextApiRequest, res: NextApiResponse) {
if (req.method !== "POST") { if (req.method !== "POST") {
return res.status(405).json({ message: "Method not allowed" }); return res.status(405).json({ message: "Method not allowed" });

View File

@ -3,11 +3,10 @@ import { NextApiRequest, NextApiResponse } from "next";
import { authenticator } from "otplib"; import { authenticator } from "otplib";
import qrcode from "qrcode"; import qrcode from "qrcode";
import { ErrorCode, getSession, verifyPassword } from "@calcom/features/auth/lib";
import { symmetricEncrypt } from "@calcom/lib/crypto"; import { symmetricEncrypt } from "@calcom/lib/crypto";
import prisma from "@calcom/prisma"; import prisma from "@calcom/prisma";
import { ErrorCode, getSession, verifyPassword } from "@lib/auth";
export default async function handler(req: NextApiRequest, res: NextApiResponse) { export default async function handler(req: NextApiRequest, res: NextApiResponse) {
if (req.method !== "POST") { if (req.method !== "POST") {
return res.status(405).json({ message: "Method not allowed" }); return res.status(405).json({ message: "Method not allowed" });

View File

@ -0,0 +1,39 @@
import { NextApiHandler, NextApiRequest, NextApiResponse } from "next";
import { HttpError } from "@calcom/lib/http-error";
const handler = async (req: NextApiRequest, res: NextApiResponse) => {
// Check that user is authenticated
const { nextauth } = req.query;
if (!Array.isArray(nextauth)) {
return res.status(404).json({ message: `API route not found` });
}
try {
/* Absolute path didn't work */
const handlerMap = (await import("./index")).authApiHandlers;
const handlerKey = nextauth.join("/");
let handler: NextApiHandler;
if (handlerKey in handlerMap) {
handler = (await handlerMap[handlerKey as keyof typeof handlerMap])?.default;
} else {
handler = (await handlerMap.default).default;
}
if (typeof handler !== "function") {
return res.status(404).json({ message: `API handler not found` });
}
return await handler(req, res);
} catch (error) {
console.error(error);
if (error instanceof HttpError) {
return res.status(error.statusCode).json({ message: error.message });
}
if (error instanceof Error) {
return res.status(400).json({ message: error.message });
}
return res.status(404).json({ message: `API handler not found` });
}
};
export default handler;

View File

@ -0,0 +1,15 @@
export const authApiHandlers = {
default: import("./auth/next-auth"),
changepw: import("./auth/changepw"),
"forgot-password": import("./auth/forgot-password"),
"reset-password": import("./auth/reset-password"),
setup: import("./auth/setup"),
signup: import("./auth/signup"),
"two-factor/totp/disable": import("./auth/two-factor/totp/disable"),
"two-factor/totp/enable": import("./auth/two-factor/totp/enable"),
"two-factor/totp/setup": import("./auth/two-factor/totp/setup"),
"saml/authorize": import("./auth/saml/authorize"),
"saml/callback": import("./auth/saml/callback"),
"saml/token": import("./auth/saml/token"),
"saml/userinfo": import("./auth/saml/userinfo"),
};

View File

@ -1,9 +1,7 @@
import classNames from "classnames"; import classNames from "classnames";
import { APP_NAME, LOGO } from "@calcom/lib/constants"; import { APP_NAME, LOGO } from "@calcom/lib/constants";
import { Credits, HeadSeo } from "@calcom/ui"; import { Credits, HeadSeo, Loader } from "@calcom/ui";
import Loader from "@components/Loader";
interface Props { interface Props {
title: string; title: string;

View File

@ -1,8 +1,7 @@
import { UserPermissionRole } from "@prisma/client";
import { useSession } from "next-auth/react"; import { useSession } from "next-auth/react";
import { FC, Fragment } from "react"; import { FC, Fragment } from "react";
import { UserPermissionRole } from ".prisma/client";
type AdminRequiredProps = { type AdminRequiredProps = {
as?: keyof JSX.IntrinsicElements; as?: keyof JSX.IntrinsicElements;
children?: React.ReactNode; children?: React.ReactNode;

View File

@ -5,7 +5,7 @@ import { useRouter } from "next/router";
import { Controller, FormProvider, useForm } from "react-hook-form"; import { Controller, FormProvider, useForm } from "react-hook-form";
import * as z from "zod"; import * as z from "zod";
import { isPasswordValid } from "@calcom/lib/auth"; import { isPasswordValid } from "@calcom/features/auth/lib";
import { WEBSITE_URL } from "@calcom/lib/constants"; import { WEBSITE_URL } from "@calcom/lib/constants";
import { useLocale } from "@calcom/lib/hooks/useLocale"; import { useLocale } from "@calcom/lib/hooks/useLocale";
import { EmailField, Label, PasswordField, TextField } from "@calcom/ui"; import { EmailField, Label, PasswordField, TextField } from "@calcom/ui";

View File

@ -1,7 +1,7 @@
import { Account, IdentityProvider, Prisma, PrismaClient, User, VerificationToken } from "@prisma/client"; import { Account, IdentityProvider, Prisma, PrismaClient, User, VerificationToken } from "@prisma/client";
import { PrismaClientKnownRequestError } from "@prisma/client/runtime"; import { PrismaClientKnownRequestError } from "@prisma/client/runtime";
import { identityProviderNameMap } from "@lib/auth"; import { identityProviderNameMap } from "./index";
/** @return { import("next-auth/adapters").Adapter } */ /** @return { import("next-auth/adapters").Adapter } */
export default function CalComAdapter(prismaClient: PrismaClient) { export default function CalComAdapter(prismaClient: PrismaClient) {

View File

@ -4,10 +4,9 @@ import { z } from "zod";
import { PaymentData } from "@calcom/app-store/stripepayment/lib/server"; import { PaymentData } from "@calcom/app-store/stripepayment/lib/server";
import prisma from "@calcom/prisma"; import prisma from "@calcom/prisma";
import { EventTypeMetaDataSchema } from "@calcom/prisma/zod-utils"; import { EventTypeMetaDataSchema } from "@calcom/prisma/zod-utils";
import { ssrInit } from "@calcom/trpc/server/ssr";
import type { inferSSRProps } from "@calcom/types/inferSSRProps"; import type { inferSSRProps } from "@calcom/types/inferSSRProps";
import { ssrInit } from "@server/lib/ssr";
export type PaymentPageProps = inferSSRProps<typeof getServerSideProps>; export type PaymentPageProps = inferSSRProps<typeof getServerSideProps>;
const querySchema = z.object({ const querySchema = z.object({

View File

@ -3,8 +3,8 @@ import Stripe from "stripe";
import { z } from "zod"; import { z } from "zod";
import { getRequestedSlugError } from "@calcom/app-store/stripepayment/lib/team-billing"; import { getRequestedSlugError } from "@calcom/app-store/stripepayment/lib/team-billing";
import { getSession } from "@calcom/features/auth/lib";
import stripe from "@calcom/features/ee/payments/server/stripe"; import stripe from "@calcom/features/ee/payments/server/stripe";
import { getSession } from "@calcom/lib/auth";
import { WEBAPP_URL } from "@calcom/lib/constants"; import { WEBAPP_URL } from "@calcom/lib/constants";
import { HttpError } from "@calcom/lib/http-error"; import { HttpError } from "@calcom/lib/http-error";
import { defaultHandler, defaultResponder } from "@calcom/lib/server"; import { defaultHandler, defaultResponder } from "@calcom/lib/server";

View File

@ -6,6 +6,7 @@
"version": "1.0.0", "version": "1.0.0",
"main": "index.ts", "main": "index.ts",
"dependencies": { "dependencies": {
"@boxyhq/saml-jackson": "1.3.6",
"@lexical/react": "^0.5.0", "@lexical/react": "^0.5.0",
"dompurify": "^2.4.1", "dompurify": "^2.4.1",
"lexical": "^0.5.0", "lexical": "^0.5.0",

View File

@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/no-explicit-any */
import cache from "memory-cache"; import cache from "memory-cache";
import { ErrorCode } from "./auth"; import { ErrorCode } from "@calcom/features/auth/lib";
const rateLimit = (options: { intervalInMs: number }) => { const rateLimit = (options: { intervalInMs: number }) => {
return { return {

View File

@ -1,8 +1,9 @@
import { GetStaticPropsContext } from "next"; import { GetStaticPropsContext } from "next";
import { i18n } from "next-i18next.config";
import { serverSideTranslations } from "next-i18next/serverSideTranslations"; import { serverSideTranslations } from "next-i18next/serverSideTranslations";
import superjson from "superjson"; import superjson from "superjson";
// @ts-expect-error vanilla js it is not typed by default
import { i18n } from "@calcom/config/next-i18next.config";
import prisma from "@calcom/prisma"; import prisma from "@calcom/prisma";
import { createProxySSGHelpers } from "@calcom/trpc/react/ssg"; import { createProxySSGHelpers } from "@calcom/trpc/react/ssg";
import { appRouter } from "@calcom/trpc/server/routers/_app"; import { appRouter } from "@calcom/trpc/server/routers/_app";

View File

@ -2,262 +2,198 @@
{ {
"/*": "This file is auto-generated and updated by `yarn app-store create/edit`. Don't edit it manually", "/*": "This file is auto-generated and updated by `yarn app-store create/edit`. Don't edit it manually",
"dirName": "routing-forms", "dirName": "routing-forms",
"categories": [ "categories": ["other"],
"other"
],
"slug": "routing-forms", "slug": "routing-forms",
"type": "routing-forms_other" "type": "routing-forms_other"
}, },
{ {
"dirName": "whereby", "dirName": "whereby",
"categories": [ "categories": ["video"],
"video"
],
"slug": "whereby", "slug": "whereby",
"type": "whereby_video" "type": "whereby_video"
}, },
{ {
"dirName": "around", "dirName": "around",
"categories": [ "categories": ["video"],
"video"
],
"slug": "around", "slug": "around",
"type": "around_video" "type": "around_video"
}, },
{ {
"dirName": "riverside", "dirName": "riverside",
"categories": [ "categories": ["video"],
"video"
],
"slug": "riverside", "slug": "riverside",
"type": "riverside_video" "type": "riverside_video"
}, },
{ {
"dirName": "typeform", "dirName": "typeform",
"categories": [ "categories": ["other"],
"other"
],
"slug": "typeform", "slug": "typeform",
"type": "typeform_other" "type": "typeform_other"
}, },
{ {
"dirName": "ping", "dirName": "ping",
"categories": [ "categories": ["video"],
"video"
],
"slug": "ping", "slug": "ping",
"type": "ping_video" "type": "ping_video"
}, },
{ {
"dirName": "campfire", "dirName": "campfire",
"categories": [ "categories": ["video"],
"video"
],
"slug": "campfire", "slug": "campfire",
"type": "campfire_video" "type": "campfire_video"
}, },
{ {
"dirName": "rainbow", "dirName": "rainbow",
"categories": [ "categories": ["web3"],
"web3"
],
"slug": "rainbow", "slug": "rainbow",
"type": "rainbow_web3" "type": "rainbow_web3"
}, },
{ {
"dirName": "raycast", "dirName": "raycast",
"categories": [ "categories": ["other"],
"other"
],
"slug": "raycast", "slug": "raycast",
"type": "raycast_other" "type": "raycast_other"
}, },
{ {
"dirName": "n8n", "dirName": "n8n",
"categories": [ "categories": ["automation"],
"automation"
],
"slug": "n8n", "slug": "n8n",
"type": "n8n_automation" "type": "n8n_automation"
}, },
{ {
"dirName": "exchangecalendar", "dirName": "exchangecalendar",
"categories": [ "categories": ["calendar"],
"calendar"
],
"slug": "exchange", "slug": "exchange",
"type": "exchange_calendar" "type": "exchange_calendar"
}, },
{ {
"dirName": "qr_code", "dirName": "qr_code",
"categories": [ "categories": ["other"],
"other"
],
"slug": "qr_code", "slug": "qr_code",
"type": "qr_code_other" "type": "qr_code_other"
}, },
{ {
"dirName": "weather_in_your_calendar", "dirName": "weather_in_your_calendar",
"categories": [ "categories": ["other"],
"other"
],
"slug": "weather_in_your_calendar", "slug": "weather_in_your_calendar",
"type": "weather_in_your_calendar_other" "type": "weather_in_your_calendar_other"
}, },
{ {
"dirName": "fathom", "dirName": "fathom",
"categories": [ "categories": ["analytics"],
"analytics"
],
"slug": "fathom", "slug": "fathom",
"type": "fathom_analytics" "type": "fathom_analytics"
}, },
{ {
"dirName": "plausible", "dirName": "plausible",
"categories": [ "categories": ["analytics"],
"analytics"
],
"slug": "plausible", "slug": "plausible",
"type": "plausible_analytics" "type": "plausible_analytics"
}, },
{ {
"dirName": "wordpress", "dirName": "wordpress",
"categories": [ "categories": ["other"],
"other"
],
"slug": "wordpress", "slug": "wordpress",
"type": "wordpress_other" "type": "wordpress_other"
}, },
{ {
"dirName": "ga4", "dirName": "ga4",
"categories": [ "categories": ["analytics"],
"analytics"
],
"slug": "ga4", "slug": "ga4",
"type": "ga4_analytics" "type": "ga4_analytics"
}, },
{ {
"dirName": "pipedream", "dirName": "pipedream",
"categories": [ "categories": ["automation"],
"automation"
],
"slug": "pipedream", "slug": "pipedream",
"type": "pipedream_automation" "type": "pipedream_automation"
}, },
{ {
"dirName": "sirius_video", "dirName": "sirius_video",
"categories": [ "categories": ["video"],
"video"
],
"slug": "sirius_video", "slug": "sirius_video",
"type": "sirius_video_video" "type": "sirius_video_video"
}, },
{ {
"dirName": "sendgrid", "dirName": "sendgrid",
"categories": [ "categories": ["other"],
"other"
],
"slug": "sendgrid", "slug": "sendgrid",
"type": "sendgrid_other_calendar" "type": "sendgrid_other_calendar"
}, },
{ {
"dirName": "closecom", "dirName": "closecom",
"categories": [ "categories": ["other"],
"other"
],
"slug": "closecom", "slug": "closecom",
"type": "closecom_other_calendar" "type": "closecom_other_calendar"
}, },
{ {
"dirName": "whatsapp", "dirName": "whatsapp",
"categories": [ "categories": ["video"],
"video"
],
"slug": "whatsapp", "slug": "whatsapp",
"type": "whatsapp_video" "type": "whatsapp_video"
}, },
{ {
"dirName": "telegram", "dirName": "telegram",
"categories": [ "categories": ["video"],
"video"
],
"slug": "telegram", "slug": "telegram",
"type": "telegram_video" "type": "telegram_video"
}, },
{ {
"dirName": "signal", "dirName": "signal",
"categories": [ "categories": ["video"],
"video"
],
"slug": "signal", "slug": "signal",
"type": "signal_video" "type": "signal_video"
}, },
{ {
"dirName": "vimcal", "dirName": "vimcal",
"categories": [ "categories": ["calendar"],
"calendar"
],
"slug": "vimcal", "slug": "vimcal",
"type": "vimcal_other" "type": "vimcal_other"
}, },
{ {
"dirName": "amie", "dirName": "amie",
"categories": [ "categories": ["calendar"],
"calendar"
],
"slug": "amie", "slug": "amie",
"type": "amie_other" "type": "amie_other"
}, },
{ {
"dirName": "booking-pages-tag", "dirName": "booking-pages-tag",
"categories": [ "categories": ["analytics"],
"analytics"
],
"slug": "booking-pages-tag", "slug": "booking-pages-tag",
"type": "booking-pages-tag_other", "type": "booking-pages-tag_other",
"isTemplate": true "isTemplate": true
}, },
{ {
"dirName": "event-type-app-card", "dirName": "event-type-app-card",
"categories": [ "categories": ["other"],
"other"
],
"slug": "event-type-app-card", "slug": "event-type-app-card",
"type": "event-type-app-card_other", "type": "event-type-app-card_other",
"isTemplate": true "isTemplate": true
}, },
{ {
"dirName": "event-type-location-video-static", "dirName": "event-type-location-video-static",
"categories": [ "categories": ["video"],
"video"
],
"slug": "event-type-location-video-static", "slug": "event-type-location-video-static",
"type": "event-type-location-video-static_other", "type": "event-type-location-video-static_other",
"isTemplate": true "isTemplate": true
}, },
{ {
"dirName": "general-app-settings", "dirName": "general-app-settings",
"categories": [ "categories": ["other"],
"other"
],
"slug": "general-app-settings", "slug": "general-app-settings",
"type": "general-app-settings_other", "type": "general-app-settings_other",
"isTemplate": true "isTemplate": true
}, },
{ {
"dirName": "link-as-an-app", "dirName": "link-as-an-app",
"categories": [ "categories": ["other"],
"other"
],
"slug": "link-as-an-app", "slug": "link-as-an-app",
"type": "link-as-an-app_other", "type": "link-as-an-app_other",
"isTemplate": true "isTemplate": true
}, },
{ {
"dirName": "basic", "dirName": "basic",
"categories": [ "categories": ["other"],
"other"
],
"slug": "basic", "slug": "basic",
"type": "basic_other", "type": "basic_other",
"isTemplate": true "isTemplate": true

View File

@ -5,7 +5,7 @@ import dailyMeta from "@calcom/app-store/dailyvideo/_metadata";
import googleMeetMeta from "@calcom/app-store/googlevideo/_metadata"; import googleMeetMeta from "@calcom/app-store/googlevideo/_metadata";
import zoomMeta from "@calcom/app-store/zoomvideo/_metadata"; import zoomMeta from "@calcom/app-store/zoomvideo/_metadata";
import dayjs from "@calcom/dayjs"; import dayjs from "@calcom/dayjs";
import { hashPassword } from "@calcom/lib/auth"; import { hashPassword } from "@calcom/features/auth/lib";
import { DEFAULT_SCHEDULE, getAvailabilityFromSchedule } from "@calcom/lib/availability"; import { DEFAULT_SCHEDULE, getAvailabilityFromSchedule } from "@calcom/lib/availability";
import prisma from "."; import prisma from ".";

View File

@ -2,7 +2,7 @@ import type { GetServerSidePropsContext } from "next";
import type { Session } from "next-auth"; import type { Session } from "next-auth";
import { serverSideTranslations } from "next-i18next/serverSideTranslations"; import { serverSideTranslations } from "next-i18next/serverSideTranslations";
import { getSession } from "@calcom/lib/auth"; import { getSession } from "@calcom/features/auth/lib";
import { WEBAPP_URL } from "@calcom/lib/constants"; import { WEBAPP_URL } from "@calcom/lib/constants";
import { getLocaleFromHeaders } from "@calcom/lib/i18n"; import { getLocaleFromHeaders } from "@calcom/lib/i18n";
import { defaultAvatarSrc } from "@calcom/lib/profile"; import { defaultAvatarSrc } from "@calcom/lib/profile";

View File

@ -15,11 +15,10 @@ import { DailyLocationType } from "@calcom/core/location";
import { getRecordingsOfCalVideoByRoomName } from "@calcom/core/videoClient"; import { getRecordingsOfCalVideoByRoomName } from "@calcom/core/videoClient";
import dayjs from "@calcom/dayjs"; import dayjs from "@calcom/dayjs";
import { sendCancelledEmails, sendFeedbackEmail } from "@calcom/emails"; import { sendCancelledEmails, sendFeedbackEmail } from "@calcom/emails";
import { ErrorCode, verifyPassword } from "@calcom/features/auth/lib";
import { samlTenantProduct } from "@calcom/features/ee/sso/lib/saml"; import { samlTenantProduct } from "@calcom/features/ee/sso/lib/saml";
import { isPrismaObjOrUndefined, parseRecurringEvent } from "@calcom/lib"; import { isPrismaObjOrUndefined, parseRecurringEvent } from "@calcom/lib";
import getEnabledApps from "@calcom/lib/apps/getEnabledApps"; import getEnabledApps from "@calcom/lib/apps/getEnabledApps";
import { ErrorCode, verifyPassword } from "@calcom/lib/auth";
import { IS_SELF_HOSTED, IS_TEAM_BILLING_ENABLED } from "@calcom/lib/constants";
import { symmetricDecrypt } from "@calcom/lib/crypto"; import { symmetricDecrypt } from "@calcom/lib/crypto";
import getStripeAppData from "@calcom/lib/getStripeAppData"; import getStripeAppData from "@calcom/lib/getStripeAppData";
import hasKeyInMetadata from "@calcom/lib/hasKeyInMetadata"; import hasKeyInMetadata from "@calcom/lib/hasKeyInMetadata";
@ -43,7 +42,7 @@ import { authRouter } from "./viewer/auth";
import { availabilityRouter } from "./viewer/availability"; import { availabilityRouter } from "./viewer/availability";
import { bookingsRouter } from "./viewer/bookings"; import { bookingsRouter } from "./viewer/bookings";
import { eventTypesRouter } from "./viewer/eventTypes"; import { eventTypesRouter } from "./viewer/eventTypes";
import { samlRouter } from "./viewer/saml"; // import { samlRouter } from "./viewer/saml";
import { slotsRouter } from "./viewer/slots"; import { slotsRouter } from "./viewer/slots";
import { viewerTeamsRouter } from "./viewer/teams"; import { viewerTeamsRouter } from "./viewer/teams";
import { webhookRouter } from "./viewer/webhook"; import { webhookRouter } from "./viewer/webhook";
@ -1156,7 +1155,7 @@ export const viewerRouter = mergeRouters(
apiKeys: apiKeysRouter, apiKeys: apiKeysRouter,
slots: slotsRouter, slots: slotsRouter,
workflows: workflowsRouter, workflows: workflowsRouter,
saml: samlRouter, // saml: samlRouter,
// NOTE: Add all app related routes in the bottom till the problem described in @calcom/app-store/trpc-routers.ts is solved. // NOTE: Add all app related routes in the bottom till the problem described in @calcom/app-store/trpc-routers.ts is solved.
// After that there would just one merge call here for all the apps. // After that there would just one merge call here for all the apps.
appRoutingForms: app_RoutingForms, appRoutingForms: app_RoutingForms,

Some files were not shown because too many files have changed in this diff Show More