Skip to content

Commit

Permalink
Avoid name clash on Oauth2Token
Browse files Browse the repository at this point in the history
Update doc and templates
pelle#144
  • Loading branch information
mremond committed Feb 2, 2014
1 parent d4ae78d commit 81300d5
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ http://oauth.net

There are several changes to the latest OAuth 2.0 spec which requires a couple of changes to 2 models which you are REQUIRED to update manually if you are supporting OAuth2.

https://github.com/pelle/oauth-plugin/blob/master/lib/generators/active_record/oauth_provider_templates/oauth2_token.rb
https://github.com/pelle/oauth-plugin/blob/master/lib/generators/active_record/oauth_provider_templates/oauth2_provider_token.rb

class Oauth2Token < AccessToken
class Oauth2ProviderToken < AccessToken
attr_accessor :state
def as_json(options={})
d = {:access_token=>token, :token_type => 'bearer'}
Expand Down Expand Up @@ -50,7 +50,7 @@ https://github.com/pelle/oauth-plugin/blob/master/lib/generators/active_record/o

def exchange!(params={})
OauthToken.transaction do
token = Oauth2Token.create! :user=>user,:client_application=>client_application, :scope => scope
token = Oauth2ProviderToken.create! :user=>user,:client_application=>client_application, :scope => scope
invalidate!
token
end
Expand Down
2 changes: 1 addition & 1 deletion generators/oauth_provider/oauth_provider_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def manifest
m.template 'oauth_token.rb', File.join('app/models',"oauth_token.rb")
m.template 'request_token.rb', File.join('app/models',"request_token.rb")
m.template 'access_token.rb', File.join('app/models',"access_token.rb")
m.template 'oauth2_token.rb', File.join('app/models',"oauth2_token.rb")
m.template 'oauth2_provider_token.rb', File.join('app/models',"oauth2_provider_token.rb")
m.template 'oauth2_verifier.rb', File.join('app/models',"oauth2_verifier.rb")
m.template 'oauth_nonce.rb', File.join('app/models',"oauth_nonce.rb")

Expand Down
2 changes: 1 addition & 1 deletion lib/generators/active_record/oauth_provider_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def copy_models
template 'oauth_token.rb', File.join('app/models', 'oauth_token.rb')
template 'request_token.rb', File.join('app/models', 'request_token.rb')
template 'access_token.rb', File.join('app/models', 'access_token.rb')
template 'oauth2_token.rb', File.join('app/models', 'oauth2_token.rb')
template 'oauth2_provider_token.rb', File.join('app/models', 'oauth2_provider_token.rb')
template 'oauth2_verifier.rb', File.join('app/models', 'oauth2_verifier.rb')
template 'oauth_nonce.rb', File.join('app/models', 'oauth_nonce.rb')
end
Expand Down
2 changes: 1 addition & 1 deletion lib/generators/mongoid/oauth_provider_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def copy_models
template 'oauth_token.rb', File.join('app/models', 'oauth_token.rb')
template 'request_token.rb', File.join('app/models', 'request_token.rb')
template 'access_token.rb', File.join('app/models', 'access_token.rb')
template 'oauth2_token.rb', File.join('app/models', 'oauth2_token.rb')
template 'oauth2_provider_token.rb', File.join('app/models', 'oauth2_provider_token.rb')
template 'oauth2_verifier.rb', File.join('app/models', 'oauth2_verifier.rb')
template 'oauth_nonce.rb', File.join('app/models', 'oauth_nonce.rb')
end
Expand Down
2 changes: 1 addition & 1 deletion oauth-plugin.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Gem::Specification.new do |s|
s.add_development_dependency "rack-test"

s.add_dependency "multi_json"
s.add_dependency("oauth", ["~> 0.4.4"])
s.add_dependency("oauth", "~> 0.4.4")
s.add_dependency("rack")
s.add_dependency("oauth2", '>= 0.5.0')
end
Expand Down

0 comments on commit 81300d5

Please sign in to comment.