omniauth-multiprovider 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +13 -18
  3. data/.rspec +2 -0
  4. data/.ruby-gemset +1 -0
  5. data/.ruby-version +1 -0
  6. data/Gemfile +4 -0
  7. data/{LICENSE → LICENSE.txt} +0 -0
  8. data/README.md +52 -7
  9. data/Rakefile +2 -0
  10. data/lib/omniauth-multiprovider.rb +3 -1
  11. data/lib/omniauth/multiprovider.rb +0 -1
  12. data/lib/omniauth/multiprovider/config.rb +25 -0
  13. data/lib/omniauth/multiprovider/controllers/callbacks_controller.rb +43 -3
  14. data/lib/omniauth/multiprovider/error.rb +24 -1
  15. data/lib/omniauth/multiprovider/models/active_record.rb +14 -0
  16. data/lib/omniauth/multiprovider/models/authentication.rb +1 -9
  17. data/lib/omniauth/multiprovider/models/concerns/omni_authenticable.rb +79 -32
  18. data/lib/omniauth/multiprovider/version.rb +1 -1
  19. data/lib/omniauth/provider/abstract.rb +6 -38
  20. data/lib/omniauth/provider/generic.rb +10 -13
  21. data/omniauth-multiprovider.gemspec +15 -2
  22. data/spec/omniauth/error_spec.rb +30 -0
  23. data/spec/omniauth/multiprovider/controllers/callbacks_controller_spec.rb +90 -0
  24. data/spec/omniauth/multiprovider/models/active_record_spec.rb +21 -0
  25. data/spec/omniauth/multiprovider/models/concerns/omni_authenticable_spec.rb +67 -0
  26. data/spec/omniauth/provider/abstract_spec.rb +15 -0
  27. data/spec/omniauth/provider/facebook_spec.rb +13 -0
  28. data/spec/omniauth/provider/generic_spec.rb +13 -0
  29. data/spec/rails_app/.gitignore +17 -0
  30. data/spec/rails_app/Rakefile +6 -0
  31. data/spec/rails_app/app/assets/images/.keep +0 -0
  32. data/spec/rails_app/app/assets/javascripts/application.js +16 -0
  33. data/spec/rails_app/app/assets/stylesheets/application.css +15 -0
  34. data/spec/rails_app/app/controllers/application_controller.rb +5 -0
  35. data/spec/rails_app/app/controllers/concerns/.keep +0 -0
  36. data/spec/rails_app/app/helpers/application_helper.rb +2 -0
  37. data/spec/rails_app/app/mailers/.keep +0 -0
  38. data/spec/rails_app/app/models/.keep +0 -0
  39. data/spec/rails_app/app/models/concerns/.keep +0 -0
  40. data/spec/rails_app/app/models/user.rb +4 -0
  41. data/spec/rails_app/app/views/layouts/application.html.erb +14 -0
  42. data/spec/rails_app/bin/bundle +3 -0
  43. data/spec/rails_app/bin/rails +4 -0
  44. data/spec/rails_app/bin/rake +4 -0
  45. data/spec/rails_app/bin/setup +29 -0
  46. data/spec/rails_app/config.ru +4 -0
  47. data/spec/rails_app/config/application.rb +26 -0
  48. data/spec/rails_app/config/boot.rb +3 -0
  49. data/spec/rails_app/config/database.yml +25 -0
  50. data/spec/rails_app/config/environment.rb +5 -0
  51. data/spec/rails_app/config/environments/test.rb +42 -0
  52. data/spec/rails_app/config/initializers/assets.rb +11 -0
  53. data/spec/rails_app/config/initializers/backtrace_silencers.rb +7 -0
  54. data/spec/rails_app/config/initializers/cookies_serializer.rb +3 -0
  55. data/spec/rails_app/config/initializers/devise.rb +259 -0
  56. data/spec/rails_app/config/initializers/filter_parameter_logging.rb +4 -0
  57. data/spec/rails_app/config/initializers/inflections.rb +16 -0
  58. data/spec/rails_app/config/initializers/mime_types.rb +4 -0
  59. data/spec/rails_app/config/initializers/session_store.rb +3 -0
  60. data/spec/rails_app/config/initializers/wrap_parameters.rb +14 -0
  61. data/spec/rails_app/config/locales/en.yml +23 -0
  62. data/spec/rails_app/config/routes.rb +3 -0
  63. data/spec/rails_app/config/secrets.yml +22 -0
  64. data/spec/rails_app/db/seeds.rb +7 -0
  65. data/spec/rails_app/lib/assets/.keep +0 -0
  66. data/spec/rails_app/lib/tasks/.keep +0 -0
  67. data/spec/rails_app/public/404.html +67 -0
  68. data/spec/rails_app/public/422.html +67 -0
  69. data/spec/rails_app/public/500.html +66 -0
  70. data/spec/rails_app/public/favicon.ico +0 -0
  71. data/spec/rails_app/public/robots.txt +5 -0
  72. data/spec/spec_helper.rb +43 -0
  73. data/spec/support/shared_examples_for_providers.rb +27 -0
  74. metadata +226 -7
  75. data/lib/omniauth/multiprovider/helpers.rb +0 -23
  76. data/lib/omniauth/provider/guests.rb +0 -12
@@ -1,23 +0,0 @@
1
- module OmniAuth
2
- module MultiProvider
3
- def self.authentication_klass
4
- Authentication
5
- end
6
-
7
- def self.resource_klass
8
- User
9
- end
10
-
11
- def self.resource_mapping
12
- :user
13
- end
14
-
15
- def self.current_resource
16
- "current_#{resource_mapping}".to_sym
17
- end
18
-
19
- def self.authentication_relationship_name
20
- :authentications
21
- end
22
- end
23
- end
@@ -1,12 +0,0 @@
1
- module OmniAuth
2
- module Provider
3
- class Guests < Abstract
4
-
5
- def self.authenticate(resource, authentication, omniauth_data)
6
- return nil unless authentication.access_token == omniauth_data.credentials.token
7
- resource
8
- end
9
-
10
- end
11
- end
12
- end