diff options
author | Stef Walter <stef@memberwebs.com> | 2010-02-11 04:01:12 +0000 |
---|---|---|
committer | Stef Walter <stef@memberwebs.com> | 2010-02-11 04:01:12 +0000 |
commit | 3969967cfc767daf6e5f52b58e8dd7305443160d (patch) | |
tree | 9211599acd52419d6da4f267d35050e34e771ac3 /module/consumer.cc | |
parent | cec165f2c1850c8c2a8430969330ad5abe63a521 (diff) |
Implement redirect after a successful authentication option.
Diffstat (limited to 'module/consumer.cc')
-rw-r--r-- | module/consumer.cc | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/module/consumer.cc b/module/consumer.cc index e4d2906..3d1686c 100644 --- a/module/consumer.cc +++ b/module/consumer.cc @@ -641,3 +641,26 @@ sid_consumer_authenticate(sid_request_t *req, sid_storage_t *store, begin_auth (req, consumer, trust_root, identity, attributes); } } + +void +sid_consumer_redirect_after (sid_request_t *req) +{ + assert (req); + + const char *qs = sid_request_qs (req); + + params_t params; + parse_query_string (qs, params); + + params_t unused; + filter_prefixed_params (params, unused, "openid."); + + string url = sid_request_url (req, 1); + if (!params.empty()) + url = params.append_query (url, ""); + + sid_request_respond_headers (req, 302, "Found", + "Location", url.c_str(), + "Cache-Control", "no-cache", + NULL); +} |