Ejemplo n.º 1
0
        public void SetPassword(Account account, string password)
        {
            if (account == null)
                throw new AccountNotFoundException();

            account.Email = account.Email.ToLowerInvariant().Trim();
            account.PasswordHash = _hasher.Hash(account.Email, password);
        }
Ejemplo n.º 2
0
        public void Register(string email, string password, Location location)
        {
            var account = new Account
                {
                    Email = email,
                    Location = location
                };

            _changeAccountPasswords.SetPassword(account, password);

            try
            {
                _session.StoreUnique(account, a => a.Email);
            }
            catch (ConcurrencyException)
            {
                throw new AccountAlreadyExistsException();
            }
        }