Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Rails 2.x #146

Open
wants to merge 7 commits into from

1 participant

@tianhsky

Here are the fixes for rails 2.x, could you create another branch called rails_2.x so that it doesn't affect your master branch, thanks.

Tianyu Huang and others added some commits
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 5, 2014
  1. fix for rails 2.3

    Tianyu Huang authored
  2. update readme

    Tianyu Huang authored
  3. fix

    Tianyu Huang authored
  4. update doc

    Tianyu Huang authored
  5. fix for rails 2.x

    Tianyu Huang authored
Commits on Mar 25, 2014
  1. redirect to callback_url if current user has been authronized and tok…

    Tianyu Huang authored
    …en still valid
Commits on Apr 7, 2014
  1. Revert "redirect to callback_url if current user has been authronized…

    Tianyu Huang authored
    … and token still valid"
    
    This reverts commit 8aa91c7.
This page is out of date. Refresh to see the latest.
View
2  generators/oauth_provider/templates/oauth2_authorize.html.erb
@@ -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]%>
View
4 lib/oauth/rack/oauth_filter.rb
@@ -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
@@ -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
Something went wrong with that request. Please try again.