summaryrefslogtreecommitdiffabout
path: root/lib/consumer.cc
authorMichael Krelin <hacker@klever.net>2007-08-09 11:31:28 (UTC)
committer Michael Krelin <hacker@klever.net>2007-08-09 11:31:28 (UTC)
commitccabea66fe29ae41458d47d7004d28e225caf41a (patch) (unidiff)
treeeb7e6cc2afa3fffe7eafad439113ba2363a74278 /lib/consumer.cc
parent65bab7c9f984d6fe45ce72e7db014c40eba4d240 (diff)
downloadlibopkele-ccabea66fe29ae41458d47d7004d28e225caf41a.zip
libopkele-ccabea66fe29ae41458d47d7004d28e225caf41a.tar.gz
libopkele-ccabea66fe29ae41458d47d7004d28e225caf41a.tar.bz2
fix to previous commit
Diffstat (limited to 'lib/consumer.cc') (more/less context) (ignore whitespace changes)
-rw-r--r--lib/consumer.cc2
1 files changed, 0 insertions, 2 deletions
diff --git a/lib/consumer.cc b/lib/consumer.cc
index af309c1..8f66688 100644
--- a/lib/consumer.cc
+++ b/lib/consumer.cc
@@ -135,26 +135,24 @@ namespace opkele {
135 p["mode"]="checkid_setup"; 135 p["mode"]="checkid_setup";
136 else 136 else
137 throw bad_input(OPKELE_CP_ "unknown checkid_* mode"); 137 throw bad_input(OPKELE_CP_ "unknown checkid_* mode");
138 string iurl = canonicalize(identity); 138 string iurl = canonicalize(identity);
139 string server, delegate; 139 string server, delegate;
140 retrieve_links(iurl,server,delegate); 140 retrieve_links(iurl,server,delegate);
141 p["identity"] = delegate.empty()?iurl:delegate; 141 p["identity"] = delegate.empty()?iurl:delegate;
142 if(!trust_root.empty()) 142 if(!trust_root.empty())
143 p["trust_root"] = trust_root; 143 p["trust_root"] = trust_root;
144 p["return_to"] = return_to; 144 p["return_to"] = return_to;
145 try { 145 try {
146 string ah = find_assoc(server)->handle(); 146 string ah = find_assoc(server)->handle();
147 if(ah->is_expired()) /* TODO: or should I throw some other exception to force programmer fix his implementation? */
148 throw failed_lookup(OPKELE_CP_ "find_assoc() has returned expired handle");
149 p["assoc_handle"] = ah; 147 p["assoc_handle"] = ah;
150 }catch(failed_lookup& fl) { 148 }catch(failed_lookup& fl) {
151 string ah = associate(server)->handle(); 149 string ah = associate(server)->handle();
152 p["assoc_handle"] = ah; 150 p["assoc_handle"] = ah;
153 } 151 }
154 if(ext) ext->checkid_hook(p,identity); 152 if(ext) ext->checkid_hook(p,identity);
155 return p.append_query(server); 153 return p.append_query(server);
156 } 154 }
157 155
158 void consumer_t::id_res(const params_t& pin,const string& identity,extension_t *ext) { 156 void consumer_t::id_res(const params_t& pin,const string& identity,extension_t *ext) {
159 if(pin.has_param("openid.user_setup_url")) 157 if(pin.has_param("openid.user_setup_url"))
160 throw id_res_setup(OPKELE_CP_ "assertion failed, setup url provided",pin.get_param("openid.user_setup_url")); 158 throw id_res_setup(OPKELE_CP_ "assertion failed, setup url provided",pin.get_param("openid.user_setup_url"));