public static Account VerifyLogin(LoginUser loginUser) { var register = GetRegister(loginUser.UserName); if (register != null) { var hashString = HashFunctionEncryption.Encrypt(loginUser.Password, register.Salt); if (hashString == register.LoginUser.Password) { return(register.Account); } } return(null); }
public static void ResetPasswork(LoginUser loginUser) { var register = GetRegister(loginUser.UserName); if (register != null) { var salt = Guid.NewGuid(); register.Salt = salt; register.LoginUser.Password = HashFunctionEncryption.Encrypt(loginUser.Password, salt); } else { throw new InstanceNotFoundException(); } }