From 4c52ca010a55d304204df450634b4fda62be8425 Mon Sep 17 00:00:00 2001 From: pearl-truss Date: Wed, 17 Jan 2024 12:28:31 -0500 Subject: [PATCH] pr fixes for better error message and remove duplicate code --- services/app-api/src/authn/thirdPartyAuthn.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/services/app-api/src/authn/thirdPartyAuthn.ts b/services/app-api/src/authn/thirdPartyAuthn.ts index fc2c67f3bf..d591baddb5 100644 --- a/services/app-api/src/authn/thirdPartyAuthn.ts +++ b/services/app-api/src/authn/thirdPartyAuthn.ts @@ -9,23 +9,19 @@ export async function userFromThirdPartyAuthorizer( userId: string ): Promise> { 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) } }