Skip to content

Commit

Permalink
Minor cleanup at skye's suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicknakin committed Apr 18, 2024
1 parent 69d1c22 commit d92d520
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions nt-web-app/identity/forgejo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,7 @@ const getUser = async (accessToken: string): Promise<UserData> => {
'Authorization': `Bearer ${accessToken}`
}
})
.then((res) => {
console.log(res.data);
return res.data
})
.then((res) => res.data);
}

const getUsersById = async (userIds: string[]): Promise<UserData[] | null> => {
Expand Down
2 changes: 1 addition & 1 deletion nt-web-app/pages/api/auth/refresh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit d92d520

Please sign in to comment.