Пример #1
0
        public async Task CreatePasswordResetVerificationCodePassword(
            CreatePasswordResetVerificationCodeRequest request)
        {
            await EnsureInGroupAsync(request);

            _authenticationApi.Start(request);
        }
Пример #2
0
        public VerificationCodeCreatedEvent CreatePasswordResetVerificationCode(
            CreatePasswordResetVerificationCodeRequest request)
        {
            var expiry                 = DateTimeOffset.UtcNow.AddMinutes(5);
            var verificationCode       = new ShortGuid(Guid.NewGuid());
            var hashedVerificationCode = _cryptoService.CreateHash(verificationCode);
            var userDto                = _userUowFactory.SetVerificationCode(request.Email, VerificationPurpose.ResetPassword,
                                                                             hashedVerificationCode, expiry);
            var verificationCodeEvent = new VerificationCodeCreatedEvent
            {
                UserKey   = userDto.Key,
                Recipient = new EmailParticipant
                {
                    EmailAddress = userDto.Email.Address,
                    Name         = userDto.PersonName.FullName()
                },
                VerificationPurpose       = VerificationPurpose.ResetPassword,
                PlainTextVerificationCode = verificationCode,
                ExpirationTime            = expiry
            }.LinkTo(request);

            return(verificationCodeEvent);
        }
Пример #3
0
        public void Handle(CreatePasswordResetVerificationCodeRequest message)
        {
            var verificationCodeCreatedEvent = _verificationService.CreatePasswordResetVerificationCode(message);

            PublishToBus(verificationCodeCreatedEvent);
        }
Пример #4
0
 public void Start(CreatePasswordResetVerificationCodeRequest request)
 {
     SendToBus(request, _commonBusEndpointSettings.Identity);
 }