Skip to content
Discussion options

You must be logged in to vote

There's a distinction between "defining the routes" and "rendering the routes." You do want all your routes to be defined unconditionally, you don't want your routes to be rendered in response to a request unconditionally. If the authentication state is stored in a signal, then a Show or conditional around an Outlet should work. If the authentication state is stored in a resource, then Suspense around an Outlet.

I don't think there's any reason this needs to be a local resource but of course I could be wrong. If you use plain create_blocking_resource and read it in a Suspense that renders either the Outlet or a Redirect, you should be fine. Note that it needs to be a blocking resource for…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@gbj
Comment options

gbj Sep 13, 2023
Maintainer

Answer selected by sambonbonne
@sambonbonne
Comment options

@gbj
Comment options

gbj Sep 13, 2023
Maintainer

@sambonbonne
Comment options

@sambonbonne
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants