pass() is a helper function that returns a guard result indicating access should be allowed.
Type Signature
Behavior
When a guard returnspass():
- 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:
See Also
- Guards Overview - Understanding guards
- hidden() - Deny access and show 404
- redirectTo() - Redirect to another path