Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails 2.x #146

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -1,5 +1,5 @@
<h1>Authorize access to your account</h1>
<p>Would you like to authorize <%%= link_to @token.client_application.name,@token.client_application.url %> (<%%= link_to @token.client_application.url,@token.client_application.url %>) to access your account?</p>
<p>Would you like to authorize <%%= link_to @client_application.name,@client_application.url %> (<%%= link_to @client_application.url,@client_application.url %>) to access your account?</p>
<%% form_tag authorize_url do %>
<%%= hidden_field_tag "response_type", params[:response_type]%>
<%%= hidden_field_tag "client_id", params[:client_id]%>
Expand Down
4 changes: 2 additions & 2 deletions lib/oauth/rack/oauth_filter.rb
Expand Up @@ -24,7 +24,7 @@ def call(env)
env["oauth_plugin"] = true
strategies = []
if token_string = oauth2_token(request)
if token = Oauth2Token.where('invalidated_at IS NULL and authorized_at IS NOT NULL and token = ?', token_string).first
if token = Oauth2Token.find(:all, :conditions=>['invalidated_at IS NULL and authorized_at IS NOT NULL and token = ?', token_string]).first
env["oauth.token"] = token
env["oauth.version"] = 2
strategies << :oauth20_token
Expand All @@ -42,7 +42,7 @@ def call(env)
client_application.token_callback_url = request_proxy.oauth_callback if request_proxy.oauth_callback

if request_proxy.token
oauth_token = client_application.tokens.where('invalidated_at IS NULL AND authorized_at IS NOT NULL and token = ?', request_proxy.token).first
oauth_token = client_application.tokens.find(:all, :conditions=>['invalidated_at IS NULL AND authorized_at IS NOT NULL and token = ?', request_proxy.token]).first
if oauth_token.respond_to?(:provided_oauth_verifier=)
oauth_token.provided_oauth_verifier = request_proxy.oauth_verifier
end
Expand Down