import { inject } from '@angular/core';
import { ResolveFn } from '@angular/router';
import { take } from 'rxjs/operators';

import { UserService } from '@services';

export const authResolver: ResolveFn<boolean> = () => {
    return inject(UserService).isAuthenticated.pipe(take(1));
};