added interceptor and authService to manage log

This commit is contained in:
2026-03-24 19:08:34 +01:00
parent 491c57b061
commit ef2afb0b58
66 changed files with 1815 additions and 777 deletions
+14 -4
View File
@@ -1,7 +1,9 @@
import {Component, signal} from '@angular/core';
import {Component, inject, signal, viewChild} from '@angular/core';
import {IonicModule} from "@ionic/angular";
import {SignInFormComponent} from "../../components/sign-in-form/sign-in-form.component";
import {SignOnFormComponent} from "../../components/sign-on-form/sign-on-form.component";
import {firstValueFrom} from "rxjs";
import {AuthManageService} from "../../services/auth-manage";
@Component({
selector: 'app-login',
@@ -15,13 +17,21 @@ import {SignOnFormComponent} from "../../components/sign-on-form/sign-on-form.co
})
export class LoginComponent {
authState = signal<boolean>(true)
login = viewChild<SignInFormComponent>('loginForm');
createAccount(): void {
private authManageService = inject(AuthManageService);
createAccount() {
if (this.authState()) {
this.authState.set(false);
}else
if (this.authState() == false) {
} else if (this.authState() == false) {
this.authState.set(true);
}
}
connectUser() {
const user = this.login().loginForm.getRawValue();
console.log(user);
this.authManageService.connectUser(user.username, user.password);
}
}