-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
Hi +1 for this package,
While exposing the routes is a good thing, Is there a way one can group the routes exposed and show only some on some certain scenarios?
Imagine when you are not authenticated, and have a dashboard route, I won't want to expose this. How about we have
@ellmetha let me know your thoughts on this, or rather if this package handles it in another way. Else I can send a PR for this.
JS_ROUTES_INCLUSION_LIST = [
{
'guest': ['home', 'about', 'privacy_policy' .... ]
},
{
'auth': ['home', 'about', 'privacy_policy', 'dashboard.index', 'dashboard.posts' .... ]
},
]
With this, a logic can be put on our front-ends as -
{% if user.is_authenticated %}
{% js_routes group='auth' %}
{% else %}
{% js_routes group='guest' %}
{% endif %}
Metadata
Metadata
Assignees
Labels
No labels