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); }
public bool AuthenticationIsGranted(GlobalPasswordHashModel model) { return(_passwordCryptologizer.EncryptString(_configuration.GameMasterPasswordHash + model.Salt) == model.Hash); }