From d92d520d2c39081b840602364d3c1a11a6d6814e Mon Sep 17 00:00:00 2001 From: Nicholas Kinney Date: Wed, 17 Apr 2024 19:18:35 -0500 Subject: [PATCH] Minor cleanup at skye's suggestion --- nt-web-app/identity/forgejo.ts | 5 +---- nt-web-app/pages/api/auth/refresh.ts | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/nt-web-app/identity/forgejo.ts b/nt-web-app/identity/forgejo.ts index 8c6c7d3..2b4578b 100644 --- a/nt-web-app/identity/forgejo.ts +++ b/nt-web-app/identity/forgejo.ts @@ -57,10 +57,7 @@ const getUser = async (accessToken: string): Promise => { 'Authorization': `Bearer ${accessToken}` } }) - .then((res) => { - console.log(res.data); - return res.data - }) + .then((res) => res.data); } const getUsersById = async (userIds: string[]): Promise => { diff --git a/nt-web-app/pages/api/auth/refresh.ts b/nt-web-app/pages/api/auth/refresh.ts index 6fa4c24..8ca6b3d 100644 --- a/nt-web-app/pages/api/auth/refresh.ts +++ b/nt-web-app/pages/api/auth/refresh.ts @@ -55,7 +55,7 @@ export default async function handler( switch (user.provider as LoginProvider) { case provider: - //get the user from the Twitch API using TWITCH_CLIENT_ID and TWITCH_API_KEY + //get the user from the provider if possible, else throw a 502 const userData = await getUsersById([userSub]) if (!userData || userData.length === 0) { res.status(502).end("502 Failed to get user data from identity provider");