# Route Guard

*noun*

say it: **“ROWT GARD”** **/raʊt ɡɑːrd/**

A function that decides whether the router may go to a route, such as only for signed-in users.

## What is **Route Guard**?

A **route guard** is a function the router runs before entering (or leaving) a route. It can block the navigation, for example sending logged-out users to the login page.

```typescript
export const authGuard: CanActivateFn = () =>
  inject(AuthService).isLoggedIn() || inject(Router).parseUrl('/login');

{ path: 'account', component: Account, canActivate: [authGuard] }
```

## In a sentence

- “A **route guard** sends anyone who isn't signed in from /orders to the login page.”

Level: Journeyman · [More Angular terms at this level](https://www.ask-codey.com/glossary?category=angular&level=3)

Updated: November 9, 2026

Source: https://www.ask-codey.com/glossary/route-guard
