Skip to content

Commit

Permalink
Fix openid auth. Closes #224
Browse files Browse the repository at this point in the history
  • Loading branch information
bugdone committed Feb 2, 2019
1 parent 3007581 commit 21864cb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/hsbox/handler.clj
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,11 @@
(update-in response [:headers] merge {"Pragma" "no-cache" "Cache-Control" "no-cache, must-revalidate"}))))

(defn credential-fn [stuff]
(if (= (:identity stuff) (str "http://steamcommunity.com/openid/id/" (:steamid @openid-settings)))
(assoc stuff :roles #{::admin})
nil))
(let [steam-openid (str "steamcommunity.com/openid/id/" (:steamid @openid-settings))]
(if (or (= (:identity stuff) (str "https://" steam-openid))
(= (:identity stuff) (str "http://" steam-openid)))
(assoc stuff :roles #{::admin})
nil)))

(defn create-secured-app []
(let [max-nonce-age 60000
Expand Down

0 comments on commit 21864cb

Please sign in to comment.