From 21864cb1a655a51f37e83bd5e0a4550f69ee4d9b Mon Sep 17 00:00:00 2001 From: bugdone Date: Sat, 2 Feb 2019 13:05:05 +0200 Subject: [PATCH] Fix openid auth. Closes #224 --- src/hsbox/handler.clj | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/hsbox/handler.clj b/src/hsbox/handler.clj index 8ec555e..e0e865e 100644 --- a/src/hsbox/handler.clj +++ b/src/hsbox/handler.clj @@ -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