Fork me on GitHub

Wow, css is a deep hole.


Can anyone share their methods of dealing with authentication/authorization with For example, when making requests that require token authorization, where does the token come from? Do you store it in the app-state or as a global variable somewhere? If it's in the app-state, how do you pass the state through to send fn?


I feel like it should be part of the app-state, since whether the user is authenticated affects what and how components are rendered


cemerick worked great for us. We store users database connection in a atom and handle autorizations from the ring handler. But you can also add user authentiacions in a atom in the backend manually.


@hlolli im more interested in the client side actually


I was trying to store a JWT token in the app-state that I send with nearly every request, but I couldn't see a way to pass it through the read functions into send


ok, as friend sends the user a cookie I've never dealt with that. Im interested to learn JWT, just open thought, can't you add it as authorization header in the post function (for example transit-post).


Yep, you add it as a header in the post function. My question is basically 'how to get the token to the post function'? I want login to be a mutation that saves a token on to app-state, rather than for the token to be a global variable, because in my mind the app-state should dictate what gets rendered and login status is part of that.


that's a good question, I guess you need to either a) dereference the atom directly, b) add it as parameter in all reads and get it trough the query which you can access in the post function. Maybe someone knows tricks how to merge this into all parser remote calls. In worst case add this to a cookie, no, dont do that 🙂


Has anyone had any experience adding componentWillMount and ...Unmount to a devcard (not the root to be devcarded). Need to initialize some stoff when card gets mounten and remove when unmounted. Don't find anything in the documentation or source.