Fix type assertions in Discord callback
cgen-716ea5b936c24ad699a03be069e0afda
This commit is contained in:
parent
990cdb459a
commit
bed085f1ea
1 changed files with 2 additions and 2 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue