Permalink
Browse files

mongoid compatible

  • Loading branch information...
1 parent 3d29abe commit 66f45e211093d797129f4c7118c9487b59350774 Giang NGUYEN committed May 14, 2012
Showing with 15 additions and 1 deletion.
  1. +13 −1 provider/README.md
  2. +2 −0 provider/config/routes.rb
View
14 provider/README.md
@@ -152,4 +152,16 @@ E.g:
@token = ::RequestToken.where(:token => params[:oauth_token]).first
```
-- `undefined method 'expand_complex_criteria' for #<Array:0x00000102934308>` (still fixing)
+- `undefined method 'expand_complex_criteria' for #<Array:0x00000102934308>`
+
+In `lib/oauth/rack/oauth_filter.rb` of `oauth-plugin` gem, find the line (around line #27) which reads:
+`if token = Oauth2Token.first(:conditions => ['invalidated_at IS NULL AND authorized_at IS NOT NULL and token = ?', token_string])`
+
+change it to
+`if token = Oauth2Token.where(:invalidated_at => nil, :authorized_at.ne => nil, :token => token_string).first`
+
+Then find the line (around #45) which reads:
+`oauth_token = client_application.tokens.first(:conditions => { :token => request_proxy.token })`
+
+change it to
+`oauth_token = client_application.tokens.where(:token => request_proxy.token).first`
View
2 provider/config/routes.rb
@@ -1,4 +1,6 @@
Provider::Application.routes.draw do
+ get 'data/index'
+
resources :oauth_clients
match '/oauth/test_request', :to => 'oauth#test_request', :as => :test_request

0 comments on commit 66f45e2

Please sign in to comment.