fix fields not found in forms

This commit is contained in:
2025-05-15 21:16:52 -07:00
parent 547fd9befc
commit 4db77ab78d
4 changed files with 22 additions and 17 deletions
@@ -55,8 +55,8 @@
ReturnURL = string.IsNullOrEmpty(ReturnURL) ? "/" : ReturnURL;
ErrorMsgs = new List<string>();
if(UserName != null ) {
if(Password != null ) {
if( !string.IsNullOrEmpty(UserName) ) {
if( !string.IsNullOrEmpty(Password) ) {
if (Password.Length >= 6 ) {
HttpResponseMessage TestLogin = await Http.PostAsJsonAsync("api/account/login", new MistoxWebsite.Shared.Account(){ UserName = UserName, PasswordHash = Password, EmailVerified = StayLoggedIn });
string result = await TestLogin.Content.ReadAsStringAsync();
@@ -75,10 +75,10 @@
ErrorMsgs = new List<string>();
if (Email != null){
if ( !string.IsNullOrEmpty(Email) ){
if( CheckEmail( Email ) ) {
if(UserName != null ) {
if(Password != null ) {
if( !string.IsNullOrEmpty(UserName) ) {
if( !string.IsNullOrEmpty(Password) ) {
if (Password.Length >= 6 ) {
HttpResponseMessage TestRegister = await Http.PostAsJsonAsync("api/account/register", new Account(){
UserName = UserName,
@@ -4,7 +4,7 @@
<form class="center big-frame background-border">
<h3>Reset Password</h3>
<span>User: @UserName</span>
<h2>User: @UserName</h2>
<div class="frame-item">
<input type="password" placeholder=" " @bind="NewPassword" @onkeyup="OnKeyDown" />
<label>New Password</label>
@@ -50,15 +50,23 @@
protected async Task TryChange() {
Result = "Waiting on response from server";
HttpResponseMessage TestLogin = await Http.PostAsJsonAsync("api/account/resetpassword", new Account(){ UserName = UserName, PasswordHash = NewPassword, Error = ResetPwd });
string result = await TestLogin.Content.ReadAsStringAsync();
bool success = result == "true" ? true : false;
if (success){
Result = "Password changed successfully";
await Task.Delay(2000);
Nav.NavigateTo("/", true);
if (NewPassword.Length >= 6){
if (NewPassword != RepeatPassword){
HttpResponseMessage TestLogin = await Http.PostAsJsonAsync("api/account/resetpassword", new Account(){ UserName = UserName, PasswordHash = NewPassword, Error = ResetPwd });
string result = await TestLogin.Content.ReadAsStringAsync();
bool success = result == "true" ? true : false;
if (success){
Result = "Password changed successfully";
await Task.Delay(2000);
Nav.NavigateTo("/", true);
}else{
Result = "Something is wrong";
}
}else{
Result = "Passwords must match";
}
}else{
Result = "Something is wrong";
Result = "Password must be at least 6 Characters long";
}
}