IsHashSupported() 공개 정적인 메소드

Check if hash is supported
public static IsHashSupported ( string hashString ) : bool
hashString string the hash
리턴 bool
        public ActionResult Settings([Bind(Include = "email,name,phone,password, occupation")]
                                     Person person)
        {
            string email = Request["email"];


            System.Diagnostics.Debug.WriteLine(person.phone);
            if (person == null)
            {
                System.Diagnostics.Debug.WriteLine("person is null");
            }
            else
            {
                System.Diagnostics.Debug.WriteLine("går den ud");
                string confirmPassword = Request["password_confirm"];
                person.name  = Request["name"];
                person.email = Request["email"];
                person.phone = Request["phone"];
                bool isHashed = SecurePasswordHasher.IsHashSupported(Request["password"]);
                person.password = SecurePasswordHasher.Hash(Request["password"]);


                db.People.AddOrUpdate(person);

                db.SaveChanges();
            }

            return(RedirectToAction("Home"));
        }
예제 #2
0
 public User(string name, string email, string password, EUserProfile profile = EUserProfile.User, bool active = true)
 {
     Name     = name;
     Email    = email;
     Password = !SecurePasswordHasher.IsHashSupported(password) ? SecurePasswordHasher.Hash(password) : password;
     Profile  = profile;
     Active   = active;
 }
예제 #3
0
 public async Task <CustomerModel> EditProfile(CustomerModel data)
 {
     if (!SecurePasswordHasher.IsHashSupported(data.Password = SecurePasswordHasher.Hash(data.Password)))
     {
         data.Password = SecurePasswordHasher.Hash(data.Password);
     }
     return(await _api.PutAsync($"/customers/{data.ID}", data));
 }