This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-05-07
Channels
- # announcements (7)
- # beginners (123)
- # calva (27)
- # cider (23)
- # clj-kondo (4)
- # cljsrn (7)
- # clojure (29)
- # clojure-dev (7)
- # clojure-europe (4)
- # clojure-italy (4)
- # clojure-nl (16)
- # clojure-uk (47)
- # clojurescript (1)
- # code-reviews (4)
- # cursive (4)
- # data-science (4)
- # datomic (30)
- # duct (4)
- # fulcro (4)
- # graphql (1)
- # kaocha (4)
- # mount (8)
- # off-topic (13)
- # overtone (1)
- # pedestal (2)
- # planck (3)
- # re-frame (9)
- # reagent (50)
- # ring (12)
- # shadow-cljs (38)
- # spacemacs (5)
- # testing (13)
- # tools-deps (55)
- # vim (30)
- # xtdb (13)
hi everyone. what’s a good way to restrict users from accessing a private
route? basically if they’re not logged in, they should be redirected to login page..
at the moment, my routes are dispatching set-active-page
action, that determines which page component to load. should I be doing this logged-in?
check at events level?
ex have one "public" app that might have a login form and other things unauthorized users can access, once they've logged in they are redirected to the private route that has the "private" app
at the moment it’s all SPA. So initially I land on Login page and I’m using JWT authentication and then I’m setting an access token in my local storage + re-frame db. so let’s say I have two routes - /about-us and /dashboard. If I type in http://mysite.com/dashboard and visit the page as a guest, at the moment I’m getting a partially rendered page, as there is no user info set and dashboard needs the user ID to query some stuff via graphql. so that’s what I’m trying to solve basically