feat(login): added support for otel push-based logs, metrics, and traces (#11429)

This commit is contained in:
Mridang Agarwalla
2026-03-04 15:58:56 +05:30
committed by GitHub
parent 685be24dfe
commit 3f3413a230
41 changed files with 4182 additions and 350 deletions
+6 -3
View File
@@ -1,5 +1,6 @@
"use server";
import { createLogger } from "@/lib/logger";
import {
createInviteCode,
getLoginSettings,
@@ -28,6 +29,8 @@ import { createSessionAndUpdateCookie } from "./cookie";
import { getPublicHostWithProtocol } from "./host";
import { getTranslations } from "next-intl/server";
const logger = createLogger("verify");
export async function verifyTOTP(code: string, loginName?: string, organization?: string) {
const _headers = await headers();
const { serviceConfig } = getServiceConfig(_headers);
@@ -63,11 +66,11 @@ export async function sendVerification(command: VerifyUserByEmailCommand) {
const verifyResponse = command.isInvite
? await verifyInviteCode({ serviceConfig, userId: command.userId, verificationCode: command.code }).catch((error) => {
console.warn(error);
logger.warn("Could not verify invite:", { error });
return { error: t("errors.couldNotVerifyInvite") };
})
: await verifyEmail({ serviceConfig, userId: command.userId, verificationCode: command.code }).catch((error) => {
console.warn(error);
logger.warn("Could not verify email:", { error });
return { error: t("errors.couldNotVerifyEmail") };
});
@@ -102,7 +105,7 @@ export async function sendVerification(command: VerifyUserByEmailCommand) {
})
.catch((error) => {
// user session is not found, so we create a new one
console.warn("[verify] user session is not found, so we create a new one", error);
logger.warn("[verify] user session is not found, so we create a new one", { error });
return undefined;
});
}