Files
library/apps/frontend/src/app/initializers/auth.initializer.ts
T
naomi b6d66d34cb feat: initial prototype works
I can log in and create a book! Woo!
2026-02-04 12:17:05 -08:00

17 lines
423 B
TypeScript

/**
* @copyright 2026 NHCarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
import { AuthService } from '../services/auth.service';
import { catchError, of } from 'rxjs';
export function initializeAuth(authService: AuthService) {
return () => authService.getCurrentUser().pipe(
catchError(() => {
// If not authenticated, that's okay - just continue
return of(null);
})
);
}