Skip to main content
pass() is a helper function that returns a guard result indicating access should be allowed.

Type Signature

Behavior

When a guard returns pass():
  • Guard chain continues: The next guard in the array is evaluated
  • Component renders: If all guards pass, the route component renders
  • No side effects: Does not modify navigation or perform redirects

Basic Usage

Conditional Access

Most commonly used with conditional logic:

With Multiple Guards

When multiple guards are used, pass() allows the chain to continue:

Common Patterns

Role Check

Feature Flag Check

Permission Check (Async)

Plan-Based Access

Guard Execution Flow

Guards execute in order and stop on the first non-pass() result:

Return Value

pass() returns a GuardResult object:
This object is processed by AppShell’s routing system to determine whether to render the route component.

See Also