Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add option for successful/failed checkid_immediate request based on o…

…penid.success request param. Inculde user_setup_url in faild (setup_needed) response.
  • Loading branch information...
commit f8217fa8726136c9d5a78f63843a284c39dadcbb 1 parent 0836ff4
@tquackenbush tquackenbush authored
Showing with 16 additions and 6 deletions.
  1. +16 −6 lib/rots/server_app.rb
  2. BIN  rots-0.2.1.gem
View
22 lib/rots/server_app.rb
@@ -62,11 +62,11 @@ def is_checkid_immediate?
end
def process_immediate_checkid_request
- # TODO: We should enable the user to configure
- # if she wants immediate request support or not
- url = OpenID::Util.append_args(@openid_request.return_to,
- @request.params.merge('openid.mode' => 'setup_needed'))
- redirect(url)
+ if checkid_immediate_is_valid?
+ return_successful_openid_response
+ else
+ return_setup_needed_openid_response
+ end
end
def process_checkid_request
@@ -80,7 +80,11 @@ def process_checkid_request
def checkid_request_is_valid?
@request.params['openid.success'] == 'true'
end
-
+
+ def checkid_immediate_is_valid?
+ @request.params['openid.success'] == 'true'
+ end
+
def return_successful_openid_response
@openid_response = @openid_request.answer(true)
process_sreg_extension
@@ -99,6 +103,12 @@ def return_cancel_openid_response
redirect(@openid_request.cancel_url)
end
+ def return_setup_needed_openid_response
+ setup_needed_args = @request.params.merge('openid.mode' => 'setup_needed', 'user_setup_url' => '')
+ url = OpenID::Util.append_args(@openid_request.return_to, setup_needed_args)
+ redirect(url)
+ end
+
def reply_consumer
web_response = @server.encode_response(@openid_response)
case web_response.code
View
BIN  rots-0.2.1.gem
Binary file not shown
Please sign in to comment.
Something went wrong with that request. Please try again.