generated from nhcarrigan/template
b6d66d34cb
I can log in and create a book! Woo!
17 lines
423 B
TypeScript
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);
|
|
})
|
|
);
|
|
} |