Skip to content

Commit

Permalink
fix origin for password recovery
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeh committed Oct 18, 2024
1 parent 1a71c5d commit cb3136c
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,15 @@ export class RequestPasswordRecoveryHandler
) {}

async execute(command: RequestPasswordRecoveryCommand): Promise<void> {
const { email } = command;
const { email, origin } = command;
const user = await this.users.findByEmail(email);
if (!user) {
this.eventBus.publish(new PasswordRecoveryRequestedEvent(email, null));
throw new NotFoundException(`Email ${email} not found`);
}
await this.authMailer.sendPasswordRecoveryEmail({
user,
// TODO: Origin must come from env vars
origin: 'http://localhost:3000',
origin,
});
this.eventBus.publish(new PasswordRecoveryRequestedEvent(email, user.id));
}
Expand Down

0 comments on commit cb3136c

Please sign in to comment.