Compare commits
20 Commits
main
...
feat/calco
Author | SHA1 | Date | |
---|---|---|---|
64fc828744 | |||
e21f86fb17 | |||
796e9edccb | |||
ef9bbaf889 | |||
3ae98e537e | |||
f25fae335d | |||
213489c202 | |||
2bba63f9f0 | |||
7bc14e8cf9 | |||
c8d573983d | |||
798adb2627 | |||
b8978b48bf | |||
1c12339479 | |||
94e6007245 | |||
1046f92c76 | |||
50ee78a92b | |||
6c2919cb91 | |||
1a1e267b29 | |||
f5580a44ac | |||
68b41f2816 |
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit a74ac5ec4c13ebf14a827f8cfc4704e271fa0c6b
|
|
@ -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
|
||||||
|
|
|
@ -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";
|
||||||
|
|
||||||
|
|
|
@ -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";
|
||||||
|
|
||||||
|
|
|
@ -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";
|
||||||
|
|
||||||
|
|
|
@ -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";
|
||||||
|
|
||||||
|
|
|
@ -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";
|
||||||
|
|
||||||
|
|
|
@ -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",
|
|
||||||
};
|
|
|
@ -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 = [
|
||||||
|
|
|
@ -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": "*",
|
||||||
|
|
|
@ -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();
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
export { default } from "@calcom/features/auth/api/dynamicHandler";
|
|
@ -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 }) {
|
||||||
|
|
|
@ -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 }) {
|
||||||
|
|
|
@ -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([
|
||||||
|
|
|
@ -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";
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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",
|
||||||
|
|
|
@ -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(),
|
||||||
});
|
});
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -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]`);
|
||||||
|
|
|
@ -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", {
|
||||||
|
|
|
@ -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,
|
||||||
});
|
});
|
||||||
|
|
|
@ -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();
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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];
|
||||||
|
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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"];
|
||||||
|
|
||||||
|
|
|
@ -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";
|
||||||
|
|
|
@ -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 (
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -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 (
|
||||||
<>
|
<>
|
||||||
|
|
|
@ -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 (
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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();
|
||||||
|
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -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();
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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";
|
||||||
|
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -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";
|
||||||
|
|
||||||
|
|
|
@ -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";
|
||||||
|
|
||||||
|
|
|
@ -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";
|
||||||
|
|
||||||
|
|
|
@ -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";
|
||||||
|
|
||||||
|
|
|
@ -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";
|
||||||
|
|
||||||
|
|
|
@ -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 (
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
|
@ -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 (
|
||||||
|
|
|
@ -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";
|
||||||
|
|
||||||
|
|
|
@ -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\"",
|
||||||
|
|
|
@ -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);
|
||||||
|
|
||||||
|
|
|
@ -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.",
|
||||||
|
|
|
@ -23,6 +23,6 @@
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"isTemplate":true,
|
"isTemplate": true,
|
||||||
"__createdUsingCli": true
|
"__createdUsingCli": true
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,6 @@
|
||||||
"email": "support@cal.com",
|
"email": "support@cal.com",
|
||||||
"description": "A template showcasing how an app with EventType AppCard can be built e.g. Giphy, QR Code",
|
"description": "A template showcasing how an app with EventType AppCard can be built e.g. Giphy, QR Code",
|
||||||
"extendsFeature": "EventType",
|
"extendsFeature": "EventType",
|
||||||
"isTemplate":true,
|
"isTemplate": true,
|
||||||
"__createdUsingCli": true
|
"__createdUsingCli": true
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,6 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"description": "It is a template showing how to add a static URL EventType location e.g. Around, Whereby",
|
"description": "It is a template showing how to add a static URL EventType location e.g. Around, Whereby",
|
||||||
"isTemplate":true,
|
"isTemplate": true,
|
||||||
"__createdUsingCli": true
|
"__createdUsingCli": true
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,6 @@
|
||||||
"publisher": "Cal.com Inc",
|
"publisher": "Cal.com Inc",
|
||||||
"email": "support@cal.com",
|
"email": "support@cal.com",
|
||||||
"description": "It is a template showing how an App can have settings in installed section that configures the app globally e.g. Weather in your Calendar",
|
"description": "It is a template showing how an App can have settings in installed section that configures the app globally e.g. Weather in your Calendar",
|
||||||
"isTemplate":true,
|
"isTemplate": true,
|
||||||
"__createdUsingCli": true
|
"__createdUsingCli": true
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,6 @@
|
||||||
"publisher": "Cal.com, Inc.",
|
"publisher": "Cal.com, Inc.",
|
||||||
"email": "support@cal.com",
|
"email": "support@cal.com",
|
||||||
"description": "It's a template showing how an app, that is just a link to some webpage, can be made e.g. Pipedream, Amie, Vimcal.",
|
"description": "It's a template showing how an app, that is just a link to some webpage, can be made e.g. Pipedream, Amie, Vimcal.",
|
||||||
"isTemplate":true,
|
"isTemplate": true,
|
||||||
"__createdUsingCli": true
|
"__createdUsingCli": true
|
||||||
}
|
}
|
||||||
|
|
|
@ -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": {
|
||||||
|
|
|
@ -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 });
|
||||||
|
|
|
@ -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");
|
||||||
|
|
|
@ -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;
|
||||||
},
|
},
|
||||||
},
|
},
|
|
@ -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: "" });
|
|
@ -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();
|
|
@ -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";
|
|
@ -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);
|
|
@ -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" });
|
|
@ -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" });
|
|
@ -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" });
|
|
@ -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;
|
|
@ -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"),
|
||||||
|
};
|
|
@ -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;
|
|
@ -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;
|
|
@ -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";
|
|
@ -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) {
|
|
@ -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({
|
||||||
|
|
|
@ -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";
|
||||||
|
|
|
@ -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",
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
|
@ -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";
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user