import {CanActivateFn, Router} from '@angular/router';
import {inject} from '@angular/core';

export const authGuard: CanActivateFn = (route, state) => {
  const router = inject(Router);
  if (sessionStorage.getItem("author") !== null || sessionStorage.getItem("token") !== null) {
    router.navigate(['/']);
  }

  return true;
};
