jpe-controle/FencerJudgeFront/src/app/components/essentials/login/login.component.ts
ExostFlash 5a8ea53597 modif
2025-06-02 16:17:17 +02:00

25 lines
633 B
TypeScript

import { Component } from '@angular/core';
import { Router } from '@angular/router';
import { AuthService } from '@services/auth/auth.service';
@Component({
selector: 'app-login',
standalone: false,
templateUrl: './login.component.html',
styleUrl: './login.component.css',
})
export class LoginComponent {
email = '';
password = '';
errorMessage = '';
constructor(private authService: AuthService, private router: Router) {}
onSubmit() {
if (this.authService.login(this.email, this.password)) {
this.router.navigate(['/']);
} else {
this.errorMessage = 'Identifiants incorrects';
}
}
}