Signaled when the routing framework successfully matches a route with the current URL path component |
Member of Web Application (PRIM_WEB.Application)
The Match event is signaled when the routing framework successfully matches a route with the current URL path component. It is provided for the application to check its state and determine if the matched route is valid to continue.
The following code snippet shows the handling of the Match event. Specifically, spotting the use of the protected route. The user does not need to be signed-in because it triggers a redirect to the "/SignIn" path.
Evtroutine Handling(#Router.Match) Route(#Route) Allow(#Allow) Redirect(#Redirect)
If (#Route.IsProtected)
If (#IsSignedIn = true)
#Allow:= true
Else
#Redirect := #SignInRoute.Path
#RedirectOnSignIn := #Route.FullPath
Endif
Endroutine