summaryrefslogtreecommitdiff
path: root/src/chef/pages/home.clj
blob: 84f643feea1d3c63a9269e884e3eadd9daa777b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
(ns chef.pages.home
  (:require [hiccup2.core :as html]
            [ring.util.response :as ruresp]
            [chef.utils :as cutils]
            [ring.middleware.session :as rmsession]))

(defn handler [req]
  (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)))