Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Remove basic auth from production server. Closes #12.

  • Loading branch information...
commit 9a297ffafe6cc9ea9e8fbe34c5b5d0f1a69d63cb 1 parent 015b44f
Brenton Ashworth and Craig Andera authored

Showing 1 changed file with 1 addition and 14 deletions. Show diff stats Hide diff stats

  1. +1 14 src/app/clj/one/sample/prod_server.clj
15 src/app/clj/one/sample/prod_server.clj
@@ -11,24 +11,11 @@
11 11
12 12 (def ^:private root "out/public")
13 13
14   -(defn- wrap-require-auth
15   - [app]
16   - (fn [req]
17   - (let [denied-response {:headers {"WWW-Authenticate" "Basic realm=\"Restricted\""}
18   - :body "HTTP authentication required."
19   - :status 401}]
20   - (if-let [auth ((:headers req) "authorization")]
21   - (if (= auth "Basic Y3Nzazppc2F3ZXNvbWU=") ;; username=cssk,password=isawesome
22   - (app req)
23   - denied-response)
24   - denied-response))))
25   -
26 14 (defroutes app-routes
27 15 remote-routes
28 16 (-> (ANY "*" request (file-response "404.html" {:root root}))
29 17 (wrap-file root)
30   - wrap-file-info
31   - wrap-require-auth))
  18 + wrap-file-info))
32 19
33 20 (def ^:private app (-> app-routes
34 21 wrap-params))

0 comments on commit 9a297ff

Please sign in to comment.
Something went wrong with that request. Please try again.