From 5c4bceae580e4fc962ccbc30565fd4fe5d6d8cdc Mon Sep 17 00:00:00 2001 From: Andrew Hughes-Onslow Date: Wed, 7 Aug 2024 22:15:47 +0100 Subject: [PATCH] ATO-814: Added lambda facade error handling. --- .../src/services/self-service-services-service.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/express/src/services/self-service-services-service.ts b/express/src/services/self-service-services-service.ts index 3061129d6..b600b2227 100644 --- a/express/src/services/self-service-services-service.ts +++ b/express/src/services/self-service-services-service.ts @@ -84,16 +84,16 @@ export default class SelfServiceServicesService { try { const response = await this.cognito.login(email, password); + + return { + cognitoSession: nonNull(response.Session), + cognitoId: nonNull(response.ChallengeParameters?.USER_ID_FOR_SRP), + codeSentTo: nonNull(response.ChallengeParameters?.CODE_DELIVERY_DESTINATION) + }; } catch (error) { console.error(error as Error); throw error; } - - return { - cognitoSession: nonNull(response.Session), - cognitoId: nonNull(response.ChallengeParameters?.USER_ID_FOR_SRP), - codeSentTo: nonNull(response.ChallengeParameters?.CODE_DELIVERY_DESTINATION) - }; } async putUser(user: OnboardingTableItem, accessToken: string): Promise {