コード例 #1
0
 public bool AuthenticationIsGranted(GlobalPasswordHashModel model)
 {
     return(_passwordCryptologizer.EncryptString(_configuration.GameMasterPasswordHash + model.Salt) == model.Hash);
 }
コード例 #2
0
        public async static ValueTask <bool> ConfirmPassword(this IJSRuntime jsRuntime, GlobalPasswordHashModel model, IPasswordCryptologizer cryptologizer, string description = "")
        {
            var result = await jsRuntime.InvokeAsync <string>("prompt", description + Environment.NewLine + "Please enter the password!").ConfigureAwait(false);

            if (result == null)
            {
                return(false);
            }
            var hash = cryptologizer.EncryptString(cryptologizer.EncryptString(result) + model.Salt);

            return(hash == model.Hash);
        }