public HttpResponseMessage UpdatePassword(AccountPasswordResetUpdateRequest model)
        {
            ItemResponse <string> response = new ItemResponse <string>();

            response.Item = _svc.UpdatePassword(model);
            return(Request.CreateResponse(HttpStatusCode.OK, response));
        }
Beispiel #2
0
        public string UpdatePassword(AccountPasswordResetUpdateRequest model)
        {
            string email = model.Email;
            string salt;
            string passwordHash;

            string password = model.Password;

            salt = _cryptographyService.GenerateRandomString(RAND_LENGTH);
            passwordHash = _cryptographyService.Hash(password, salt, HASH_ITERATION_COUNT);

            _dataProvider.ExecuteNonQuery("dbo.Person_UpdatePassword"
                , inputParamMapper: delegate (SqlParameterCollection
                 paramCollection)
                {
                    paramCollection.AddWithValue("@Email", model.Email);
                    paramCollection.AddWithValue("@Salt", salt);
                    paramCollection.AddWithValue("PasswordHash", passwordHash);
                });
            return email;
        }