diff options
author | Tim <contact@bytim.eu> | 2025-05-10 10:59:30 +0200 |
---|---|---|
committer | Tim <contact@bytim.eu> | 2025-05-10 10:59:30 +0200 |
commit | 77594fd2b62e4ea3e6a55fed2dabcce50e618bd3 (patch) | |
tree | 5ddfa7589b5d9a46dbd40d5eea49c3e782c22d1a /src/chef/pages/home.clj | |
parent | 79e32a55801fc53c8d60843c6676ca05cc899299 (diff) | |
download | chef-77594fd2b62e4ea3e6a55fed2dabcce50e618bd3.tar.xz chef-77594fd2b62e4ea3e6a55fed2dabcce50e618bd3.zip |
Add oauth for admin interface
Diffstat (limited to 'src/chef/pages/home.clj')
-rw-r--r-- | src/chef/pages/home.clj | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/chef/pages/home.clj b/src/chef/pages/home.clj index 725ba2b..84f643f 100644 --- a/src/chef/pages/home.clj +++ b/src/chef/pages/home.clj @@ -1,10 +1,15 @@ (ns chef.pages.home (:require [hiccup2.core :as html] [ring.util.response :as ruresp] - [chef.pages.utils :as cputils])) + [chef.utils :as cutils] + [ring.middleware.session :as rmsession])) (defn handler [req] - (-> (cputils/gen-page "chef" [:i "Coming soon..."]) - html/html - str - ruresp/response)) + (let [access-token (get-in req [:oauth2/access-tokens :auth]) + resp (-> (cutils/gen-page "chef" [:i "Coming soon..."]) + html/html + str + ruresp/response)] + (if (some? access-token) + (assoc resp :session (assoc (:session req) :oauth-token access-token)) + resp))) |