From bed085f1ea6132e448f81e1c41ee67e43f3c6337 Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Sun, 16 Nov 2025 07:07:19 +0000 Subject: [PATCH] Fix type assertions in Discord callback cgen-716ea5b936c24ad699a03be069e0afda --- api/discord/oauth/callback.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/discord/oauth/callback.ts b/api/discord/oauth/callback.ts index 00c8e90c..02bd23e8 100644 --- a/api/discord/oauth/callback.ts +++ b/api/discord/oauth/callback.ts @@ -146,7 +146,7 @@ export default async function handler(req: any, res: any) { return res.redirect("/login?error=token_exchange"); } - const tokenData: DiscordTokenResponse = await tokenResponse.json(); + const tokenData = (await tokenResponse.json()) as DiscordTokenResponse; // Fetch Discord user profile const userResponse = await fetch("https://discord.com/api/v10/users/@me", { @@ -160,7 +160,7 @@ export default async function handler(req: any, res: any) { return res.redirect("/login?error=user_fetch"); } - const discordUser: DiscordUser = await userResponse.json(); + const discordUser = (await userResponse.json()) as DiscordUser; // Validate Discord user has email if (!discordUser.email) {