diff --git a/resources/templates/login.html b/resources/templates/login.html
index dca783e..37836cd 100644
--- a/resources/templates/login.html
+++ b/resources/templates/login.html
@@ -2,7 +2,7 @@
{% block big-links %}
{% for authority in authorities %}
-
+
{{authority.id}}
diff --git a/src/clj/youyesyet/routes/oauth.clj b/src/clj/youyesyet/routes/oauth.clj
index 86c4b62..0706672 100644
--- a/src/clj/youyesyet/routes/oauth.clj
+++ b/src/clj/youyesyet/routes/oauth.clj
@@ -6,17 +6,25 @@
[clojure.java.io :as io]
[youyesyet.oauth :as oauth]))
+
(defn oauth-init
"Initiates the OAuth with the authority implied by this `request`"
[request]
-;; (-> (oauth/fetch-request-token request)
-;; :oauth_token
-;; oauth/auth-redirect-uri
-;; found))
- (found
- (oauth/auth-redirect-uri
- (:oauth_token (oauth/fetch-request-token request))
- (:authority (:session request)))))
+ (let [authority (or
+ (:authority (:session request))
+ (oauth/authority! (:authority (massage-params :request))))]
+ (if
+ authority
+ (assoc-in
+ (found
+ (oauth/auth-redirect-uri
+ (:request-token
+ (oauth/fetch-request-token request authority))
+ authority))
+ [:session :authority]
+ authority))))
+ :session
+
(defn oauth-callback
"Handles the callback from the authority."