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
-3
View File
@@ -12,8 +12,5 @@ AccountInventory.cs
ProjectMistData.cs ProjectMistData.cs
Data inside the sql doesnt match what is inside the database Data inside the sql doesnt match what is inside the database
account/resetpassword
make the account your resetting password for visible in ui
ForgotPassword Email / Resetpassword Email ForgotPassword Email / Resetpassword Email
Needs styles that match the theme of the website Needs styles that match the theme of the website
@@ -55,8 +55,8 @@
ReturnURL = string.IsNullOrEmpty(ReturnURL) ? "/" : ReturnURL; ReturnURL = string.IsNullOrEmpty(ReturnURL) ? "/" : ReturnURL;
ErrorMsgs = new List<string>(); ErrorMsgs = new List<string>();
if(UserName != null ) { if( !string.IsNullOrEmpty(UserName) ) {
if(Password != null ) { if( !string.IsNullOrEmpty(Password) ) {
if (Password.Length >= 6 ) { if (Password.Length >= 6 ) {
HttpResponseMessage TestLogin = await Http.PostAsJsonAsync("api/account/login", new MistoxWebsite.Shared.Account(){ UserName = UserName, PasswordHash = Password, EmailVerified = StayLoggedIn }); HttpResponseMessage TestLogin = await Http.PostAsJsonAsync("api/account/login", new MistoxWebsite.Shared.Account(){ UserName = UserName, PasswordHash = Password, EmailVerified = StayLoggedIn });
string result = await TestLogin.Content.ReadAsStringAsync(); string result = await TestLogin.Content.ReadAsStringAsync();
@@ -75,10 +75,10 @@
ErrorMsgs = new List<string>(); ErrorMsgs = new List<string>();
if (Email != null){ if ( !string.IsNullOrEmpty(Email) ){
if( CheckEmail( Email ) ) { if( CheckEmail( Email ) ) {
if(UserName != null ) { if( !string.IsNullOrEmpty(UserName) ) {
if(Password != null ) { if( !string.IsNullOrEmpty(Password) ) {
if (Password.Length >= 6 ) { if (Password.Length >= 6 ) {
HttpResponseMessage TestRegister = await Http.PostAsJsonAsync("api/account/register", new Account(){ HttpResponseMessage TestRegister = await Http.PostAsJsonAsync("api/account/register", new Account(){
UserName = UserName, UserName = UserName,
@@ -4,7 +4,7 @@
<form class="center big-frame background-border"> <form class="center big-frame background-border">
<h3>Reset Password</h3> <h3>Reset Password</h3>
<span>User: @UserName</span> <h2>User: @UserName</h2>
<div class="frame-item"> <div class="frame-item">
<input type="password" placeholder=" " @bind="NewPassword" @onkeyup="OnKeyDown" /> <input type="password" placeholder=" " @bind="NewPassword" @onkeyup="OnKeyDown" />
<label>New Password</label> <label>New Password</label>
@@ -50,15 +50,23 @@
protected async Task TryChange() { protected async Task TryChange() {
Result = "Waiting on response from server"; Result = "Waiting on response from server";
HttpResponseMessage TestLogin = await Http.PostAsJsonAsync("api/account/resetpassword", new Account(){ UserName = UserName, PasswordHash = NewPassword, Error = ResetPwd }); if (NewPassword.Length >= 6){
string result = await TestLogin.Content.ReadAsStringAsync(); if (NewPassword != RepeatPassword){
bool success = result == "true" ? true : false; HttpResponseMessage TestLogin = await Http.PostAsJsonAsync("api/account/resetpassword", new Account(){ UserName = UserName, PasswordHash = NewPassword, Error = ResetPwd });
if (success){ string result = await TestLogin.Content.ReadAsStringAsync();
Result = "Password changed successfully"; bool success = result == "true" ? true : false;
await Task.Delay(2000); if (success){
Nav.NavigateTo("/", true); Result = "Password changed successfully";
await Task.Delay(2000);
Nav.NavigateTo("/", true);
}else{
Result = "Something is wrong";
}
}else{
Result = "Passwords must match";
}
}else{ }else{
Result = "Something is wrong"; Result = "Password must be at least 6 Characters long";
} }
} }