fix sentry errors (#20005)
This commit is contained in:
@@ -4,7 +4,7 @@ import type { NextRequest } from "next/server";
|
||||
import { NextResponse } from "next/server";
|
||||
import { z } from "zod";
|
||||
|
||||
import { AVATAR_FALLBACK } from "@calcom/lib/constants";
|
||||
import { AVATAR_FALLBACK, WEBAPP_URL } from "@calcom/lib/constants";
|
||||
import prisma from "@calcom/prisma";
|
||||
|
||||
const querySchema = z.object({
|
||||
@@ -47,7 +47,8 @@ async function handler(req: NextRequest, { params }: { params: Params }) {
|
||||
img = data;
|
||||
} catch (e) {
|
||||
// If anything goes wrong or avatar is not found, use default avatar
|
||||
return NextResponse.redirect(AVATAR_FALLBACK, 302);
|
||||
const url = new URL(AVATAR_FALLBACK, WEBAPP_URL).toString();
|
||||
return NextResponse.redirect(url, 302);
|
||||
}
|
||||
|
||||
const decoded = img.toString().replace("data:image/png;base64,", "").replace("data:image/jpeg;base64,", "");
|
||||
|
||||
Reference in New Issue
Block a user