/**
 * @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);
    })
  );
}