Route Guard

Noun · Development

Definitions

  1. A hook in a client-side router (notably Angular's CanActivate, CanDeactivate interfaces) that runs before a navigation completes, allowing the application to check conditions such as authentication status or unsaved changes and either permit, redirect, or block the transition.

    In plain English: A checkpoint that decides whether a user is allowed to visit a page in a web app, often checking if they're logged in.

    Example: "The auth route guard redirects unauthenticated users to /login before the dashboard component even loads."

Related Terms