mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-26 14:28:46 +00:00
feat(login): added support for otel push-based logs, metrics, and traces (#11429)
This commit is contained in:
@@ -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;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user