This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-06-11
Channels
- # announcements (4)
- # aws (6)
- # babashka (40)
- # beginners (318)
- # biff (4)
- # bootstrapped-cljs (9)
- # calva (19)
- # chlorine-clover (1)
- # cider (3)
- # clj-on-windows (25)
- # cljdoc (8)
- # cljfx (1)
- # cljs-dev (30)
- # cljss (2)
- # clojure (62)
- # clojure-chile (9)
- # clojure-europe (11)
- # clojure-finland (17)
- # clojure-italy (1)
- # clojure-kc (1)
- # clojure-nl (3)
- # clojure-spec (27)
- # clojure-uk (40)
- # clojuremn (1)
- # clojurescript (51)
- # conjure (6)
- # cursive (8)
- # data-science (9)
- # datahike (4)
- # datascript (1)
- # datomic (31)
- # emacs (10)
- # emotion-cljs (1)
- # events (1)
- # figwheel-main (16)
- # find-my-lib (1)
- # fulcro (30)
- # graalvm (3)
- # graphql (12)
- # helix (16)
- # honeysql (5)
- # jobs (1)
- # jobs-discuss (10)
- # juxt (3)
- # kaocha (26)
- # lambdaisland (3)
- # leiningen (15)
- # malli (7)
- # off-topic (100)
- # pathom (8)
- # pedestal (15)
- # protojure (24)
- # re-frame (2)
- # reagent (7)
- # reitit (22)
- # remote-jobs (1)
- # shadow-cljs (140)
- # spacemacs (17)
- # spire (2)
- # tools-deps (23)
- # uix (11)
- # vim (5)
- # xtdb (3)
- # yada (3)
i would like to know whats the best way of doing it because it seems to me i could somehow define the access rule in the route itself
(def rules
[{:uri "/api/user/*"
:handler authenticated-or-preflight?}
{:uri "/api/identity"
:handler authenticated-or-preflight?}])
(defn on-error
[request value]
{:status 403
:headers {
"Content-Type" "text"
}
:body "Not authorized"})
(defn my-authfn
[__ token]
(session-store/get-user-from-store token))
(def backend (backends/token {:authfn my-authfn}))
(defn wrap-base [handler]
(-> ((:middleware defaults) handler)
(wrap-access-rules {:rules rules :on-error on-error})
;(wrap-authorization auth-backend)
(wrap-authentication backend)
I was wondering if there is a way i could define it in the route itself using a reitit middlware
found an example of what i was looking here https://github.com/lipas-liikuntapaikat/lipas
Is there any way to have routes in reitit that are on the same level in the hierarchy?
I’d like to be able to have /word/add and /word/1 for the URI, but reitit is telling me it’s not allowed
Hi all, quick question. Is there an idiomatic way to do route restrictions on the front end? For the moment, I am designating some routes as public
in my routes and then my router component, is filtering in/out the public routes.