From cfbe2bbac60e9014d7ba0967e4b996fba7dc8629 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karol=20S=C3=B3jko?= Date: Tue, 12 Dec 2023 12:58:11 +0100 Subject: [PATCH] fix(auth): add user uuid context to sign in emails log context --- packages/auth/src/Domain/Event/DomainEventFactory.ts | 1 + packages/auth/src/Domain/Event/DomainEventFactoryInterface.ts | 1 + .../src/Domain/Handler/UserInvitedToSharedVaultEventHandler.ts | 1 + packages/auth/src/Domain/UseCase/SignIn.ts | 1 + 4 files changed, 4 insertions(+) diff --git a/packages/auth/src/Domain/Event/DomainEventFactory.ts b/packages/auth/src/Domain/Event/DomainEventFactory.ts index 86f7435ef..8f9b7d116 100644 --- a/packages/auth/src/Domain/Event/DomainEventFactory.ts +++ b/packages/auth/src/Domain/Event/DomainEventFactory.ts @@ -159,6 +159,7 @@ export class DomainEventFactory implements DomainEventFactoryInterface { level: string body: string subject: string + userUuid?: string }): EmailRequestedEvent { return { type: 'EMAIL_REQUESTED', diff --git a/packages/auth/src/Domain/Event/DomainEventFactoryInterface.ts b/packages/auth/src/Domain/Event/DomainEventFactoryInterface.ts index 6c3fd38e8..db6ddc7ac 100644 --- a/packages/auth/src/Domain/Event/DomainEventFactoryInterface.ts +++ b/packages/auth/src/Domain/Event/DomainEventFactoryInterface.ts @@ -31,6 +31,7 @@ export interface DomainEventFactoryInterface { level: string body: string subject: string + userUuid?: string }): EmailRequestedEvent createListedAccountRequestedEvent(userUuid: string, userEmail: string): ListedAccountRequestedEvent createUserRegisteredEvent(dto: { diff --git a/packages/auth/src/Domain/Handler/UserInvitedToSharedVaultEventHandler.ts b/packages/auth/src/Domain/Handler/UserInvitedToSharedVaultEventHandler.ts index 2e56d65fb..2561c27bc 100644 --- a/packages/auth/src/Domain/Handler/UserInvitedToSharedVaultEventHandler.ts +++ b/packages/auth/src/Domain/Handler/UserInvitedToSharedVaultEventHandler.ts @@ -35,6 +35,7 @@ export class UserInvitedToSharedVaultEventHandler implements DomainEventHandlerI subject: getSubject(), messageIdentifier: 'USER_INVITED_TO_SHARED_VAULT', userEmail: user.email, + userUuid: user.uuid, }), ) } diff --git a/packages/auth/src/Domain/UseCase/SignIn.ts b/packages/auth/src/Domain/UseCase/SignIn.ts index e54edcd83..32d7304c6 100644 --- a/packages/auth/src/Domain/UseCase/SignIn.ts +++ b/packages/auth/src/Domain/UseCase/SignIn.ts @@ -131,6 +131,7 @@ export class SignIn implements UseCaseInterface { ), messageIdentifier: 'SIGN_IN', subject: getSubject(user.email), + userUuid: user.uuid, }), ) } catch (error) {