Fork me on GitHub

hi! first of all: thanks for reitit, i like it a lot


now to my question: i'm using reitit in a re-frame app that's essentially a frontend to an api that i don't have any control over. some of the endpoints need authentication, some don't, and in addition to binary logged-in-logged-out state there's user roles that have to be considered.


so it's esentially like this: navigate somewhere, check user permissions / login status, if everything's ok: fetch data and display it, if not: show login screen and redirect to previous route on successful login


i implemented this with the old reitit pre-0.2.0 (i think?). it's a bit messy tbh because i used reitit on a very low level. any guidance on how to migrate?


i found but some actual code would be super nice


you can see the data dependencies are declared close to the router, which i think in hindsight wasn't the smartest move. i'd like to have each component declare: i need those permissions and these are the events that should happen when you try to display me... at least i think i'd like to have it like this. any opinions on this very appreciated!


uuuuh wait. 😄 i mixed up reitit and bide, oops


but i think i could do exactly what i want with reitit, no? i think at some point in the past i just mashed both libraries together in my head