Beispiel #1
0
        public void Handle(ResetPassword command)
        {
            if (command == null)
            {
                throw new ArgumentNullException("command");
            }

            // get the confirmation
            var confirmation = _entities.Get <EmailConfirmation>()
                               .ByToken(command.Token);

            _passwords.Reset(confirmation.EmailAddress.Person.User.Name, command.Password);
            confirmation.RetiredOnUtc = DateTime.UtcNow;
            confirmation.SecretCode   = null;
            confirmation.Ticket       = null;
            _entities.Update(confirmation);
        }