docker-ifyed.

This commit is contained in:
Bryce Covert
2017-12-20 10:57:08 -08:00
parent ee3ea0be2c
commit 4625ef4474
15 changed files with 63 additions and 32 deletions

View File

@@ -41,14 +41,14 @@
(defroutes unauthenticated-routes
(GET "/" []
(response/resource-response "index.html" {:root "public"}))
(GET "/api/oauth" {{:strs [code]} :query-params}
(GET "/api/oauth" {{:strs [code]} :query-params :keys [scheme] :as r {:strs [host]} :headers}
(try
(let [auth (-> "https://accounts.google.com/o/oauth2/token"
(http/post
{:form-params {"client_id" google-client-id
"client_secret" google-client-secret
"code" code
"redirect_uri" "http://localhost:3449/api/oauth"
"redirect_uri" (str (name scheme) "://" host "/api/oauth")
"grant_type" "authorization_code"}
:as :json})
:body)