I’m using the guidance from the Authentication and Authorization | The Aurelia 2 Docs to capture the route where the request is unauthenticated before redirecting to a login page. The canLoad method is defined in a global hook.
When a direct url for a nested route is entered, i.e. /europe/uk, the canload hook fires twice, once for each route in the tree, and all but the last call returns the associated route segment and “/*$$residue” so for the example url it would return /europe/*$$residue for the first call and /uk for the second.
Sample stackblitz: StackBlitz (I had to pop the sample out to see the path in the address bar)
This looks to be by design, but to capture the full path, I’d need to concatenate the values across calls unless the full path is available somewhere. Failing that, is there a context that’s shared across all these methods where this concatenated path could be stashed?