This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-10-15
Channels
- # announcements (1)
- # babashka (81)
- # beginners (48)
- # calva (49)
- # clj-kondo (52)
- # cljdoc (7)
- # cljs-dev (39)
- # clojure (33)
- # clojure-australia (18)
- # clojure-europe (48)
- # clojure-italy (2)
- # clojure-morsels (2)
- # clojure-nl (3)
- # clojure-uk (6)
- # clojurescript (5)
- # community-development (2)
- # conjure (6)
- # cursive (3)
- # data-science (29)
- # datalog (4)
- # datomic (14)
- # events (1)
- # fulcro (1)
- # graphql (18)
- # gratitude (2)
- # helix (11)
- # introduce-yourself (2)
- # java (15)
- # keyboards (2)
- # lsp (6)
- # luminus (4)
- # membrane (32)
- # minecraft (1)
- # missionary (7)
- # nextjournal (2)
- # off-topic (28)
- # portal (28)
- # releases (1)
- # ring (1)
- # shadow-cljs (3)
- # sql (6)
- # xtdb (23)
I do use wrap-defaults
already (super nice lib indeed!)
(http/run-server
(-> (routes lagosta-routes)
wrap-user-info ; gets user info (see post above)
(wrap-oauth2 okta-attrs) ; gets tokens
wrap-auth ; checks if there are okta tokens in session, redirects to /login otherwise
(wrap-defaults (-> site-defaults
(assoc-in [:session :cookie-attrs :same-site] :lax))))
{:port 3434})))
wrap-user-info
is adding the info to the session, but it’s gone if I switch to another page. This works if the “landing page” where the user is redirected after completing oauth2 responds with
(-> response (assoc-in [:session] session-with-user))
-> then the wrap-user-info
middleware just lets the request through without adding anything. Maybe my order is indeed wrong?