sorcery 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of sorcery might be problematic. Click here for more details.

Files changed (35) hide show
  1. data/README.rdoc +44 -6
  2. data/VERSION +1 -1
  3. data/lib/generators/sorcery_migration/templates/{oauth.rb → external.rb} +1 -1
  4. data/lib/sorcery/controller/submodules/email.rb +44 -0
  5. data/lib/sorcery/controller/submodules/external/protocols/oauth1.rb +35 -0
  6. data/lib/sorcery/controller/submodules/external/protocols/oauth2.rb +26 -0
  7. data/lib/sorcery/controller/submodules/{oauth → external}/providers/facebook.rb +24 -6
  8. data/lib/sorcery/controller/submodules/{oauth → external}/providers/twitter.rb +31 -6
  9. data/lib/sorcery/controller/submodules/external.rb +83 -0
  10. data/lib/sorcery/controller.rb +5 -3
  11. data/lib/sorcery/model/submodules/{oauth.rb → external.rb} +3 -3
  12. data/lib/sorcery/model.rb +9 -6
  13. data/lib/sorcery.rb +9 -7
  14. data/sorcery.gemspec +14 -12
  15. data/spec/Gemfile +1 -1
  16. data/spec/Gemfile.lock +2 -2
  17. data/spec/rails3/app_root/Gemfile +1 -1
  18. data/spec/rails3/app_root/Gemfile.lock +2 -2
  19. data/spec/rails3/app_root/app/controllers/application_controller.rb +11 -11
  20. data/spec/rails3/app_root/db/migrate/{oauth → external}/20101224223628_create_authentications.rb +0 -0
  21. data/spec/rails3/app_root/spec/controller_oauth2_spec.rb +13 -13
  22. data/spec/rails3/app_root/spec/controller_oauth_spec.rb +12 -12
  23. data/spec/rails3/app_root/spec/user_oauth_spec.rb +4 -4
  24. data/spec/rails3/app_root/spec/user_spec.rb +2 -2
  25. data/spec/sinatra/Gemfile +1 -1
  26. data/spec/sinatra/Gemfile.lock +2 -2
  27. data/spec/sinatra/db/migrate/{oauth → external}/20101224223628_create_authentications.rb +0 -0
  28. data/spec/sinatra/myapp.rb +11 -11
  29. data/spec/sinatra/spec/controller_oauth2_spec.rb +13 -13
  30. data/spec/sinatra/spec/controller_oauth_spec.rb +12 -12
  31. data/spec/sinatra/spec/user_oauth_spec.rb +4 -4
  32. data/spec/sinatra/spec/user_spec.rb +2 -2
  33. metadata +14 -12
  34. data/lib/sorcery/controller/submodules/oauth/oauth1.rb +0 -33
  35. data/lib/sorcery/controller/submodules/oauth/oauth2.rb +0 -24
@@ -1,24 +0,0 @@
1
- require 'oauth2'
2
- module Sorcery
3
- module Controller
4
- module Submodules
5
- module Oauth
6
- module Oauth2
7
- def oauth_version
8
- "2.0"
9
- end
10
-
11
- def authorize_url(*args)
12
- client = ::OAuth2::Client.new(@key, @secret, :site => @site)
13
- client.web_server.authorize_url(:redirect_uri => @callback_url, :scope => @scope)
14
- end
15
-
16
- def get_access_token(args)
17
- client = ::OAuth2::Client.new(@key, @secret, :site => @site)
18
- client.web_server.get_access_token(args[:code], :redirect_uri => @callback_url)
19
- end
20
- end
21
- end
22
- end
23
- end
24
- end