diff --git a/backend/api/controllers/user.js b/backend/api/controllers/user.js index 0001d1085..7f34eb3dd 100644 --- a/backend/api/controllers/user.js +++ b/backend/api/controllers/user.js @@ -139,13 +139,13 @@ class UserController { throw new MonkeyError(403, "Banned accounts cannot link with Discord"); } - let discordFetch = await fetch("https://discord.com/api/users/@me", { + const discordFetch = await fetch("https://discord.com/api/users/@me", { headers: { authorization: `${req.body.data.tokenType} ${req.body.data.accessToken}`, }, }); - discordFetch = await discordFetch.json(); - const did = discordFetch.id; + const discordFetchJSON = await discordFetch.json(); + const did = discordFetchJSON.id; if (!did) { throw new MonkeyError( 500, diff --git a/backend/handlers/captcha.js b/backend/handlers/captcha.js index c50a9565b..5d5f689a9 100644 --- a/backend/handlers/captcha.js +++ b/backend/handlers/captcha.js @@ -3,7 +3,7 @@ import "dotenv/config"; export async function verify(captcha) { if (process.env.MODE === "dev") return true; - let response = await fetch( + const response = await fetch( `https://www.google.com/recaptcha/api/siteverify`, { method: "POST", @@ -11,6 +11,6 @@ export async function verify(captcha) { body: `secret=${process.env.RECAPTCHA_SECRET}&response=${captcha}`, } ); - response = await response.json(); - return response?.success; + const responseJSON = await response.json(); + return responseJSON?.success; }