Fix type issues in discord token endpoint

cgen-40b986168d894c9eaeb2696c3f2464e3
This commit is contained in:
Builder.io 2025-11-16 07:08:10 +00:00
parent 237bde7c2c
commit c30d97fdf5

View file

@ -54,7 +54,7 @@ export default async function handler(req: any, res: any) {
});
}
const tokenData = await tokenResponse.json();
const tokenData = (await tokenResponse.json()) as { access_token: string; token_type: string; expires_in: number };
const accessToken = tokenData.access_token;
if (!accessToken) {
@ -74,7 +74,7 @@ export default async function handler(req: any, res: any) {
return res.status(401).json({ error: "Invalid token" });
}
const discordUser = await userResponse.json();
const discordUser = (await userResponse.json()) as { id: string; username: string };
console.log(
"[Discord Token] Token exchange successful for user:",
discordUser.id,