summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <code@mail.matthias.benkard.de>2012-02-25 23:35:11 +0100
committerMatthias Andreas Benkard <code@mail.matthias.benkard.de>2012-02-25 23:35:11 +0100
commitd1592be24041ff9e5b8185885ce42c17cf11a983 (patch)
treef25f4405299999f0de1d250df5c058074aec28c5
parent995492e70d3bea9d260caf518a89ad53841115fd (diff)
Make the OpenID login page fancier and easier to use.
-rw-r--r--src/mulk/benki/auth.clj19
-rw-r--r--static/js/openid-login.js4
2 files changed, 19 insertions, 4 deletions
diff --git a/src/mulk/benki/auth.clj b/src/mulk/benki/auth.clj
index 9c5767d..5333269 100644
--- a/src/mulk/benki/auth.clj
+++ b/src/mulk/benki/auth.clj
@@ -67,10 +67,21 @@
(session/put! :discovered discovered)
(redirect (.getDestinationUrl authreq true))))
+(def login-page-layout
+ {:head (list
+ [:link {:type "text/css", :rel "stylesheet", :href "/3rdparty/openid-selector/css/openid.css"}]
+ [:script {:type "text/javascript", :src "/3rdparty/openid-selector/js/openid-jquery.js"}]
+ [:script {:type "text/javascript", :src "/3rdparty/openid-selector/js/openid-en.js"}]
+ [:script {:type "text/javascript", :src "/js/openid-login.js"}]
+ )})
+
(defpage "/login" []
- (layout "Benki Login"
- [:p "Please enter your OpenID:"]
+ (layout login-page-layout "Benki Login"
[:form {:action (resolve-uri "/login/authenticate"),
:method "GET"}
- [:input {:type "text", :name "openid"}]
- [:input {:type "submit"}]]))
+ [:div {:id "openid_choice"}
+ [:p "Please select your OpenID provider:"]
+ [:div {:id "openid_btns"}]]
+ [:div {:id "openid_input_area"}
+ [:input {:type "text", :name "openid", :id "openid_identifier"}]
+ [:input {:type "submit"}]]]))
diff --git a/static/js/openid-login.js b/static/js/openid-login.js
new file mode 100644
index 0000000..93417c2
--- /dev/null
+++ b/static/js/openid-login.js
@@ -0,0 +1,4 @@
+$(document).ready(function() {
+ openid.img_path = '/3rdparty/openid-selector/images/';
+ openid.init('openid_identifier');
+});