Hi,
I am trying to get the open_id_authentication plugin to work with the
current edge rails, and here is what I am stuck with:
In the case statement in the authenticate_with_open_id method** (below,
copied from the plugin''s readme file), none of the cases seems to
evaluate to true and instead, the ''else'' part is executed.
This seems
odd since when I put the following in a template:
<dl>
<dt>Identity Url:</dt>
<dd><%= @identity_url %></dd>
<dt>Result:</dt>
<dd><%= debug(@result) %></dd>
<dt>Successful:</dt>
<dd><%= @result === :successful %></dd>
<dt>Current user:</dt>
<dd><%= @current_user.full_name %></dd>
</dl>
I get the following output:
Identity Url:
http://www.ingoweiss.com/
Result:
--- !ruby/object:OpenIdAuthentication::Result
code: :successful
Successful:
true
Current user:
Ingo Weiss
I just don''t get why the ''case :successful'' part in
the case statement
is never executed even though ''@result === :successful''
evaluates to
true!
Ingo
**In the controller:
def open_id_authentication
authenticate_with_open_id do |result, identity_url|
case result
when :missing
failed_login "Sorry, the OpenID server couldn''t be
found"
when :canceled
failed_login "OpenID verification was canceled"
when :failed
failed_login "Sorry, the OpenID verification failed"
when :successful
if @current_user = User.find_by_identity_url(identity_url)
successful_login
else
failed_login "Sorry, no user by that identity URL exists
(#{identity_url})"
end
else
#just for debugging:
@result = result
@identity_url = identity_url
@current_user = User.find_by_identity_url(identity_url)
end
end
end
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---