An Angular route guard is a function that decides whether a navigation is allowed: canActivate to enter a route, canDeactivate to leave it, canMatch to choose a route. It returns a boolean or a redirect. It improves the experience but does not replace server-side access control.
Example
export const authGuard: CanActivateFn = () =>
inject(AuthService).estConnecte() || inject(Router).parseUrl('/connexion');