feat: add upgrade banners for teams and organizations (#27650)
This commit is contained in:
1 parent
c197de147a
commit
b7340f7151
74 files changed
+1834
-500
No files matched your search
@@ -1,8 +1,3 @@
|
||||
import { LRUCache } from "lru-cache";
|
||||
import type { GetServerSidePropsContext, NextApiRequest } from "next";
|
||||
import type { AuthOptions, Session } from "next-auth";
|
||||
import { getToken } from "next-auth/jwt";
|
||||
|
||||
import { LicenseKeySingleton } from "@calcom/ee/common/server/LicenseKeyService";
|
||||
import { DeploymentRepository } from "@calcom/features/ee/deployment/repositories/DeploymentRepository";
|
||||
import { UserRepository } from "@calcom/features/users/repositories/UserRepository";
|
||||
@@ -10,6 +5,10 @@ import { getUserAvatarUrl } from "@calcom/lib/getAvatarUrl";
|
||||
import logger from "@calcom/lib/logger";
|
||||
import { safeStringify } from "@calcom/lib/safeStringify";
|
||||
import prisma from "@calcom/prisma";
|
||||
import { LRUCache } from "lru-cache";
|
||||
import type { GetServerSidePropsContext, NextApiRequest } from "next";
|
||||
import type { AuthOptions, Session } from "next-auth";
|
||||
import { getToken } from "next-auth/jwt";
|
||||
|
||||
const log = logger.getSubLogger({ prefix: ["getServerSession"] });
|
||||
/**
|
||||
@@ -142,3 +141,7 @@ export async function getServerSession(options: {
|
||||
log.debug("Returned session", safeStringify(session));
|
||||
return session;
|
||||
}
|
||||
|
||||
export function clearSessionCache() {
|
||||
CACHE.clear();
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
import { randomBytes, createHash } from "node:crypto";
|
||||
import { totp } from "otplib";
|
||||
|
||||
import { createHash, randomBytes } from "node:crypto";
|
||||
import process from "node:process";
|
||||
import {
|
||||
sendChangeOfEmailVerificationLink,
|
||||
sendEmailVerificationCode,
|
||||
sendEmailVerificationLink,
|
||||
sendChangeOfEmailVerificationLink,
|
||||
} from "@calcom/emails/auth-email-service";
|
||||
import { FeaturesRepository } from "@calcom/features/flags/features.repository";
|
||||
import { sentrySpan } from "@calcom/features/watchlist/lib/telemetry";
|
||||
@@ -12,9 +11,10 @@ import { checkIfEmailIsBlockedInWatchlistController } from "@calcom/features/wat
|
||||
import { checkRateLimitAndThrowError } from "@calcom/lib/checkRateLimitAndThrowError";
|
||||
import { WEBAPP_URL } from "@calcom/lib/constants";
|
||||
import logger from "@calcom/lib/logger";
|
||||
import { hashEmail } from "@calcom/lib/server/PiiHasher";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
import { hashEmail } from "@calcom/lib/server/PiiHasher";
|
||||
import { prisma } from "@calcom/prisma";
|
||||
import { totp } from "otplib";
|
||||
|
||||
const log = logger.getSubLogger({ prefix: [`[[Auth] `] });
|
||||
|
||||
@@ -25,6 +25,7 @@ interface VerifyEmailType {
|
||||
secondaryEmailId?: number;
|
||||
isVerifyingEmail?: boolean;
|
||||
isPlatform?: boolean;
|
||||
extraParams?: Record<string, string>;
|
||||
hideBranding?: boolean;
|
||||
}
|
||||
|
||||
@@ -34,6 +35,7 @@ export const sendEmailVerification = async ({
|
||||
username,
|
||||
secondaryEmailId,
|
||||
isPlatform = false,
|
||||
extraParams,
|
||||
}: VerifyEmailType) => {
|
||||
const token = randomBytes(32).toString("hex");
|
||||
const translation = await getTranslation(language ?? "en", "common");
|
||||
@@ -71,6 +73,7 @@ export const sendEmailVerification = async ({
|
||||
|
||||
const params = new URLSearchParams({
|
||||
token,
|
||||
...extraParams,
|
||||
});
|
||||
|
||||
await sendEmailVerificationLink({
|
||||
|
||||
Reference in new issue
Block a user