public async Task ForgotPasswordAsync(ForgotPasswordAdto forgotPasswordAdto) { using (ITransaction transaction = _transactionManager.Create()) { try { Identity identity = await _forgotPasswordCommand.ExecuteAsync(new ForgotPasswordCommandDdto { EmailAddress = forgotPasswordAdto.EmailAddress }); if (identity == null) { return; } await _identityCommandRepository.UpdateAsync(identity); transaction.Commit(); } catch (PasswordNotSetDomainException) { } catch (DomainValidationRuleException e) { throw new BusinessValidationRuleApplicationException(e.ValidationResult); } } }
public Task ForgotPasswordAsync(ForgotPasswordAdto forgotPasswordAdto) { return(_securityApplicationService.SecureAsync(() => _identityApplicationService.ForgotPasswordAsync(forgotPasswordAdto), DefaultAuthorisationContext.Create(AuthorisationResource.Identity, AuthorisationAction.Create))); }