コード例 #1
0
        public async Task <bool> ValidateUser()
        {
            //if is valid:
            if (PasswordValidation.IsValid(user.Password))
            {
                ((CustomAuthenticationStateProvider)AuthenticationStateProvider).MarkUserAsAuthenticated(PasswordValidation.GetHash(user.Password));

                await sessionStorage.SetItemAsync("hash", PasswordValidation.GetHash(user.Password));

                NavigationManager.NavigateTo("/editing");
            }
            else
            {
                LoginMessage = "Access is denied! Try again";
            }

            return(await Task.Run(() => true));
        }