This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-08-05
Channels
- # announcements (1)
- # babashka (5)
- # beginners (151)
- # calva (43)
- # clj-kondo (23)
- # cljdoc (1)
- # cljs-dev (6)
- # cljsrn (10)
- # clojure (60)
- # clojure-australia (1)
- # clojure-europe (26)
- # clojure-gamedev (14)
- # clojure-nl (1)
- # clojure-spec (10)
- # clojure-uk (80)
- # clojurescript (66)
- # clojureverse-ops (4)
- # community-development (7)
- # conjure (8)
- # datomic (15)
- # deps-new (1)
- # docker (27)
- # emacs (2)
- # fulcro (13)
- # honeysql (13)
- # java (5)
- # jobs-discuss (43)
- # lsp (121)
- # luminus (13)
- # malli (1)
- # off-topic (73)
- # pathom (12)
- # polylith (29)
- # practicalli (4)
- # re-frame (35)
- # reagent (44)
- # remote-jobs (5)
- # rewrite-clj (2)
- # sci (7)
- # shadow-cljs (125)
- # sql (4)
- # tools-deps (9)
- # xtdb (5)
I created a new app using lein new my-app +sqlite
. But I see some people are adding things like +re-frame +shadow-cljs +reitit
. Is there some specific list of packages that play nice with luminus?
yes, https://luminusweb.com/docs/profiles.html and I like to look at the diffs to get a feeling for what each profile does https://github.com/yogthos/luminusdiff/tree/master/src/luminusdiff
What is the best (most accurate and current) example of authentication? I’ve used it some time ago, and sometimes examples can drift away from the latest libraries.
I’m interested to know this too
Two questions on this topic:
Should a login function set :identity
on the request, or on the :session
in the request?
Also, why does wrap-base
call (dissoc :session)
after wrap-defaults
?
> Should a login function set :identity on the request, or on the :session in the request? - request attributes live for the life of that request/response cycle - session attributes for the life of that session so if you put it on the request, the identity will be wiped once user participates in another request/response cycle. In the link below the secition ==Accessing the session== you can see some example session management. > Also, why does wrap-base call (dissoc :session) after wrap-defaults ? https://luminusweb.com/docs/sessions_cookies.html
(defn wrap-base [handler]
(-> handler
wrap-dev
wrap-formats
wrap-webjars
(wrap-defaults
(-> site-defaults
(assoc-in [:security :anti-forgery] false)
(dissoc :session)))
wrap-flash
wrap-session
wrap-context
wrap-internal-error))
not 100% sure but I think its so the wrap-session below it can be assoc'd on@U010A2QSG9H Makes sense, I was probably confused by some incorrect code I was using as an example. I’m curious, though, if we can get the answer for the second question. Yours makes sense, though.
I think I figured it out. It's one of those details in the docs that you don't know is there until you happen across it. So, after authenticating, you want to set the :identity
key on the session but then any handler called within wrap-authentication
will have that value added to the request as well. So ultimately, it's in both places.
I think basic route restriction will be fine here… no JWE required at this time.