Fix type issues in discord token endpoint
cgen-40b986168d894c9eaeb2696c3f2464e3
This commit is contained in:
parent
237bde7c2c
commit
c30d97fdf5
1 changed files with 2 additions and 2 deletions
|
|
@ -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;
|
const accessToken = tokenData.access_token;
|
||||||
|
|
||||||
if (!accessToken) {
|
if (!accessToken) {
|
||||||
|
|
@ -74,7 +74,7 @@ export default async function handler(req: any, res: any) {
|
||||||
return res.status(401).json({ error: "Invalid token" });
|
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(
|
console.log(
|
||||||
"[Discord Token] Token exchange successful for user:",
|
"[Discord Token] Token exchange successful for user:",
|
||||||
discordUser.id,
|
discordUser.id,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue