Skip to content

Commit

Permalink
pr fixes for better error message and remove duplicate code
Browse files Browse the repository at this point in the history
  • Loading branch information
pearl-truss committed Jan 17, 2024
1 parent b857668 commit 4c52ca0
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions services/app-api/src/authn/thirdPartyAuthn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,19 @@ export async function userFromThirdPartyAuthorizer(
userId: string
): Promise<Result<UserType, Error | undefined>> {
try {
// Lookup user from postgress
// Lookup user from postgres
const auroraUser = await lookupUserAurora(store, userId)
if (auroraUser instanceof Error) {
return err(auroraUser)
}

if (auroraUser instanceof Error) {
return err(auroraUser)
}

if (auroraUser === undefined) {
return err(auroraUser)
}

return ok(auroraUser)
} catch (e) {
console.error('ERROR: failed to parse user from authorizer')
console.error('ERROR: failed to look user in postgres')
return err(e)
}
}

0 comments on commit 4c52ca0

Please sign in to comment.