Beispiel #1
0
        public void ResetPass(ResetPassAddRequest model)
        {
            string salt           = BCrypt.BCryptHelper.GenerateSalt();
            string hashedPassword = BCrypt.BCryptHelper.HashPassword(model.Password, salt);

            string procName = "[dbo].[Users_ResetPasswordByToken]";

            _dataProvider.ExecuteNonQuery(procName,
                                          inputParamMapper : delegate(SqlParameterCollection col)
            {
                col.AddWithValue("@Password", hashedPassword);
                col.AddWithValue("@UserToken", model.Token);    //token
            }
                                          );
        }
Beispiel #2
0
        public ActionResult <SuccessResponse> ResetPass(ResetPassAddRequest model)
        {
            int          code     = 201;
            BaseResponse response = null;

            try
            {
                //callsvc
                _service.ResetPass(model);
                response = new SuccessResponse();
            }
            catch (Exception ex)
            {
                code     = 500;
                response = new ErrorResponse(ex.Message);
            }
            return(StatusCode(code, response));
        }