Fork me on GitHub
#fulcro
<
2018-04-25
>
liesbeth13:04:32

I’ve started with a fulcro app some time ago, and now have come to the point that I would like to add a login page and authentication with a jwt. I know that I can use a pre-hook on the server side to check for the token etc. But I am wondering how to go about it on the client side. I would probably add the jwt as header to all my query and mutation requests with fulcro-http-remote. And I imagine that I would have a top router that only allows the user to see the login page when they are not signed in, and routes to the ‘rest’ of the app otherwise, but I’m not sure how such a thing would be best enforced. I’d be interested to hear how others go about this, suggestions or examples are welcome 🙂

tony.kay14:04:41

@liesbeth The fulcro-template (old one, not the lein one) has the routing part with login (including redirect after login)…it does not use JWT, but that is just headers.

liesbeth07:04:03

Thanks, I will take a look at that!