feat(auth): implement login page and authentication flow
Implement a complete authentication system including a new login page, updated authentication service, and conditional routing. - Add `LoginPage` component with animated UI and form validation - Update `AuthService` to handle user sessions, CSRF tokens, and enhanced user data structures - Implement conditional rendering in `App` component based on authentication state - Add `postRaw` and `getRaw` methods to `HttpService` for direct API interaction - Update routing to include login path and prepare for auth guards - Add rate limiting error handling (429) in `HttpService`
This commit is contained in:
+20
-4
@@ -1,10 +1,26 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { Component, inject, signal } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { LayoutComponent } from './layout/layout.component';
|
||||
import { LoginPage } from './pages/login/login.page';
|
||||
import { AuthService } from './services/auth/auth.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
imports: [LayoutComponent],
|
||||
standalone: true,
|
||||
imports: [CommonModule, LayoutComponent, LoginPage],
|
||||
templateUrl: './app.html',
|
||||
styleUrl: './app.css'
|
||||
styleUrl: './app.css',
|
||||
})
|
||||
export class App {}
|
||||
export class App {
|
||||
private readonly authService = inject(AuthService);
|
||||
|
||||
readonly isAuthenticated = signal<boolean>(this.authService.isAuthenticated());
|
||||
|
||||
constructor() {
|
||||
this.authService.currentUserSubject.subscribe({
|
||||
next: () => {
|
||||
this.isAuthenticated.set(this.authService.isAuthenticated());
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user