make env variables with dashes again

This commit is contained in:
flynn 2019-02-14 00:33:15 +01:00
parent 61433bd1f0
commit af375b6ca5
4 changed files with 15 additions and 16 deletions

View file

@ -8,11 +8,11 @@
; Inspired by https://leonid.shevtsov.me/post/oauth2-is-easy/ ; Inspired by https://leonid.shevtsov.me/post/oauth2-is-easy/
(defn- oauth2-params [] (defn- oauth2-params []
{:client-id (env :oauth_consumer_key) {:client-id (env :oauth-consumer-key)
:client-secret (env :oauth_consumer_secret) :client-secret (env :oauth-consumer-secret)
:authorize-uri (env :authorize_uri) :authorize-uri (env :authorize-uri)
:redirect_uri (str (env :app-host) "/oauth/oauth-callback") :redirect_uri (str (env :app-host) "/oauth/oauth-callback")
:access-token-uri (env :access_token_uri) :access-token-uri (env :access-token-uri)
;:scope "activity profile" ;:scope "activity profile"
}) })

View file

@ -3,15 +3,15 @@
[oauth.client :as oauth] [oauth.client :as oauth]
[mount.core :refer [defstate]] [mount.core :refer [defstate]]
[clojure.tools.logging :as log])) [clojure.tools.logging :as log]))
;
(defstate consumer ;(defstate consumer
:start (oauth/make-consumer ; :start (oauth/make-consumer
(env :oauth-consumer-key) ; (env :oauth-consumer-key)
(env :oauth-consumer-secret) ; (env :oauth-consumer-secret)
(env :request-token-uri) ; (env :request-token-uri)
(env :access-token-uri) ; (env :access-token-uri)
(env :authorize-uri) ; (env :authorize-uri)
:hmac-sha1)) ; :hmac-sha1))
(defn oauth-callback-uri (defn oauth-callback-uri
"Generates the oauth request callback URI" "Generates the oauth request callback URI"

View file

@ -1,10 +1,11 @@
(ns cat.routes.home (ns cat.routes.home
(:require [cat.layout :as layout] (:require [cat.layout :as layout]
[cat.config :refer [env]]
[cat.db.core :refer [*db*] :as db] [cat.db.core :refer [*db*] :as db]
[compojure.core :refer [defroutes GET POST]] [compojure.core :refer [defroutes GET POST]]
[ring.util.http-response :as response] [ring.util.http-response :as response]
[struct.core :as st] [struct.core :as st]
[clojure.tools.logging :as log] [clojure.tools.logginqg :as log]
[cat.layout :refer [error-page]] [cat.layout :refer [error-page]]
[clojure.string :as s])) [clojure.string :as s]))

View file

@ -1,8 +1,6 @@
(ns cat.routes.oauth (ns cat.routes.oauth
(:require [ring.util.http-response :refer [ok found]] (:require [ring.util.http-response :refer [ok found]]
[compojure.core :refer [defroutes GET]] [compojure.core :refer [defroutes GET]]
[clojure.java.io :as io]
[cat.oauth :as oauth]
[clojure.tools.logging :as log] [clojure.tools.logging :as log]
[cat.moauth :as mo] [cat.moauth :as mo]
[cat.db.core :refer [*db*] :as db])) [cat.db.core :refer [*db*] :as db]))