UI #4

Merged
derek merged 26 commits from UI into main 2025-07-18 19:59:18 -07:00
3 changed files with 15 additions and 27 deletions
Showing only changes of commit d59d476a6e - Show all commits
@@ -45,12 +45,7 @@ export class LoginComponent {
this.errorMsgs.push("Waiting for response from server");
this.auth.Login(this.UserName, this.Password, this.StayLoggedIn).subscribe(
data => {
if (data.error.length === 0){
this.router.navigate([this.returnURL]);
}else{
this.errorMsgs.pop();
this.errorMsgs.push(data.error);
}
}
)
}
@@ -68,14 +68,9 @@ export class RegisterComponent {
});
this.http.post<Account>( "api/account/register", body, { headers } ).subscribe({
next: async (data) => {
if (data.error.length === 0){
this.errorMsgs = ["Account Created"];
await this.sleep(3000);
this.router.navigate([this.returnURL]);
}else{
this.errorMsgs = [];
this.errorMsgs.push(data.error);
}
},
error: err => {
console.log("HTTP Error Signing In: ", err);
@@ -24,10 +24,8 @@ export class Authentication{
let sub = this.http.post<Account>( "api/account/login", body, { headers } );
sub.subscribe({
next: data => {
if (data.error.length === 0){
this._user.next(data);
this.setUserToStorage(data, StayLoggedIn == true ? SessionType.Forever : SessionType.Session);
}
},
error: err => {
console.log("HTTP Error Signing In: ", err);