solidus_social 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +18 -0
  3. data/.hound.yml +26 -0
  4. data/.rspec +3 -0
  5. data/.rubocop.yml +8 -0
  6. data/.travis.yml +19 -0
  7. data/CHANGELOG.md +5 -0
  8. data/CONTRIBUTING.md +31 -0
  9. data/Gemfile +7 -0
  10. data/Guardfile +10 -0
  11. data/LICENSE.md +26 -0
  12. data/README.md +148 -0
  13. data/Rakefile +15 -0
  14. data/app/assets/javascripts/spree/backend/solidus_social.js +1 -0
  15. data/app/assets/javascripts/spree/frontend/solidus_social.js +1 -0
  16. data/app/assets/stylesheets/spree/backend/solidus_social.css +3 -0
  17. data/app/assets/stylesheets/spree/frontend/fontello.css +64 -0
  18. data/app/assets/stylesheets/spree/frontend/solidus_social.css +4 -0
  19. data/app/controllers/spree/admin/authentication_methods_controller.rb +18 -0
  20. data/app/controllers/spree/omniauth_callbacks_controller.rb +67 -0
  21. data/app/controllers/spree/user_authentications_controller.rb +12 -0
  22. data/app/controllers/spree/user_registrations_controller_decorator.rb +15 -0
  23. data/app/helpers/spree/omniauth_callbacks_helper.rb +5 -0
  24. data/app/models/spree/authentication_method.rb +13 -0
  25. data/app/models/spree/social_configuration.rb +5 -0
  26. data/app/models/spree/user_authentication.rb +3 -0
  27. data/app/models/spree/user_decorator.rb +16 -0
  28. data/app/overrides/add_authentications_to_account_summary.rb +5 -0
  29. data/app/overrides/admin_configuration_decorator.rb +5 -0
  30. data/app/overrides/user_registrations_decorator.rb +17 -0
  31. data/app/views/spree/admin/authentication_methods/_form.html.erb +45 -0
  32. data/app/views/spree/admin/authentication_methods/edit.html.erb +18 -0
  33. data/app/views/spree/admin/authentication_methods/index.html.erb +54 -0
  34. data/app/views/spree/admin/authentication_methods/new.html.erb +18 -0
  35. data/app/views/spree/admin/shared/_configurations_menu.html.erb +4 -0
  36. data/app/views/spree/shared/_social.html.erb +11 -0
  37. data/app/views/spree/shared/_user_form.html.erb +19 -0
  38. data/app/views/spree/users/_new-customer.html.erb +5 -0
  39. data/app/views/spree/users/_social.html.erb +28 -0
  40. data/bin/rails +7 -0
  41. data/config/initializers/devise.rb +13 -0
  42. data/config/locales/de.yml +26 -0
  43. data/config/locales/en.yml +26 -0
  44. data/config/locales/es-MX.yml +26 -0
  45. data/config/locales/fr.yml +26 -0
  46. data/config/locales/nl.yml +26 -0
  47. data/config/locales/pt-BR.yml +26 -0
  48. data/config/locales/sv.yml +26 -0
  49. data/config/routes.rb +14 -0
  50. data/db/migrate/20120120163432_create_user_authentications.rb +10 -0
  51. data/db/migrate/20120123163222_create_authentication_methods.rb +13 -0
  52. data/lib/generators/solidus_social/install/install_generator.rb +24 -0
  53. data/lib/solidus_social.rb +10 -0
  54. data/lib/solidus_social/engine.rb +70 -0
  55. data/lib/solidus_social/version.rb +18 -0
  56. data/solidus_social.gemspec +47 -0
  57. data/spec/controllers/spree/omniauth_callbacks_controller_spec.rb +160 -0
  58. data/spec/features/spree/admin/authentication_methods_configuration_spec.rb +79 -0
  59. data/spec/features/spree/sign_in_spec.rb +81 -0
  60. data/spec/lib/spree_social/engine_spec.rb +16 -0
  61. data/spec/models/spree/user_decorator_spec.rb +54 -0
  62. data/spec/spec_helper.rb +36 -0
  63. data/spec/support/capybara.rb +18 -0
  64. data/spec/support/database_cleaner.rb +24 -0
  65. data/spec/support/devise.rb +3 -0
  66. data/spec/support/factory_girl.rb +7 -0
  67. data/spec/support/spree.rb +8 -0
  68. metadata +429 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 3fe49d36ea644340c59c66b5e8506ab57a466f6c
4
+ data.tar.gz: d42af370d565407ebdbccbe60d32fbcbef814478
5
+ SHA512:
6
+ metadata.gz: 836eb284a9553b79eec6a3738a50cb30cb37162dad469fccee63ec153b4b7c888268d8beae8564a47efae281811c0f14f9ebf1f5f72136092eb32655428f4b79
7
+ data.tar.gz: 9b458f66b04f4ab4be83f0d4c151f5096cce9ff51790a2b9de95bba362e14e602d3fd392ae817491970ca4a6bd6cc55eb4c9eb30e788a615b566632ccd9e11b1
@@ -0,0 +1,18 @@
1
+ \#*
2
+ *~
3
+ .#*
4
+ .DS_Store
5
+ .idea
6
+ .project
7
+ tmp
8
+ nbproject
9
+ *.swp
10
+ spec/dummy
11
+ .rvmrc
12
+ .bundle
13
+ Gemfile.lock
14
+ coverage
15
+ .ruby-version
16
+ .ruby-gemset
17
+ .node-version
18
+ .phantom-version
@@ -0,0 +1,26 @@
1
+ ---
2
+ # Too picky.
3
+ LineLength:
4
+ Enabled: false
5
+
6
+ # This should truly be on for well documented gems.
7
+ Documentation:
8
+ Enabled: false
9
+
10
+ # Neatly aligned code is too swell.
11
+ SingleSpaceBeforeFirstArg:
12
+ Enabled: false
13
+
14
+ # Don't mess with RSpec DSL.
15
+ Blocks:
16
+ Exclude:
17
+ - 'spec/**/*'
18
+
19
+ # We really like the readability with newline in beginning of classes.
20
+ EmptyLinesAroundBlockBody:
21
+ Enabled: false
22
+
23
+ # Use nested module/class definitions instead of compact style.
24
+ # Too high git impact to change this now.
25
+ ClassAndModuleChildren:
26
+ Enabled: false
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --colour
2
+ -r spec_helper
3
+ -f documentation
@@ -0,0 +1,8 @@
1
+ ---
2
+ inherit_from: .hound.yml
3
+
4
+ AllCops:
5
+ Exclude:
6
+ - spec/dummy/**/*
7
+ - bin/*
8
+ - Guardfile
@@ -0,0 +1,19 @@
1
+ ---
2
+ language: ruby
3
+ rvm:
4
+ - 2.1
5
+ - 2.2
6
+ - '2.3.0'
7
+ env:
8
+ matrix:
9
+ - SOLIDUS_BRANCH=master
10
+ - SOLIDUS_BRANCH=v1.2
11
+ - SOLIDUS_BRANCH=v1.1
12
+ - SOLIDUS_BRANCH=v1.0
13
+ sudo: false
14
+ before_script:
15
+ - sh -e /etc/init.d/xvfb start
16
+ - export DISPLAY=:99.0
17
+ - bundle exec rake test_app
18
+ script:
19
+ - bundle exec rspec spec
@@ -0,0 +1,5 @@
1
+ ## Solidus Social 1.0.0
2
+
3
+ * Renamed SpreeSocial to SolidusSocial
4
+ * Relaxed versions to support solidus 1.0+
5
+ * Port of https://github.com/DynamoMTL/spree_social's solidus branch
@@ -0,0 +1,31 @@
1
+ # Contributing
2
+
3
+ In the spirit of [free software][1], **everyone** is encouraged to help improve this project.
4
+
5
+ Here are some ways *you* can contribute:
6
+
7
+ * by using prerelease versions
8
+ * by reporting [bugs][2]
9
+ * by suggesting new features
10
+ * by writing [translations][3]
11
+ * by writing or editing documentation
12
+ * by writing specifications
13
+ * by writing code (*no patch is too small*: fix typos, add comments, clean up inconsistent whitespace)
14
+ * by refactoring code
15
+ * by resolving [issues][2]
16
+ * by reviewing patches
17
+
18
+ Starting point:
19
+
20
+ * Fork the repo
21
+ * Clone your repo
22
+ * Run `bundle install`
23
+ * Run `bundle exec rake test_app` to create the test application in `spec/test_app`
24
+ * Make your changes
25
+ * Ensure specs pass by running `bundle exec rspec spec`
26
+ * Ensure code style by running `rubocop .`
27
+ * Submit your pull request
28
+
29
+ [1]: http://www.fsf.org/licensing/essays/free-sw.html
30
+ [2]: https://github.com/solidusio-contrib/solidus_social/issues
31
+ [3]: https://github.com/solidusio-contrib/solidus_social/blob/master/config/locales
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ source 'https://rubygems.org'
2
+
3
+ branch = ENV.fetch('SOLIDUS_BRANCH', 'master')
4
+ gem 'solidus', github: 'solidusio/solidus', branch: branch
5
+ gem 'solidus_auth_devise'
6
+
7
+ gemspec
@@ -0,0 +1,10 @@
1
+ guard 'rspec', cmd: 'bundle exec rspec' do
2
+ watch('spec/spec_helper.rb') { 'spec' }
3
+ watch('config/routes.rb') { 'spec/controllers' }
4
+ watch(%r{^spec/(.+)_spec\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
5
+ watch(%r{^app/(.+)_decorator\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
6
+ watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
7
+ watch(%r{^app/(.*)(\.erb)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
8
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
9
+ watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb" }
10
+ end
@@ -0,0 +1,26 @@
1
+ Copyright (c) 2014 John Dyer and other contributors
2
+ All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without modification,
5
+ are permitted provided that the following conditions are met:
6
+
7
+ * Redistributions of source code must retain the above copyright notice,
8
+ this list of conditions and the following disclaimer.
9
+ * Redistributions in binary form must reproduce the above copyright notice,
10
+ this list of conditions and the following disclaimer in the documentation
11
+ and/or other materials provided with the distribution.
12
+ * Neither the name Spree nor the names of its contributors may be used to
13
+ endorse or promote products derived from this software without specific
14
+ prior written permission.
15
+
16
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
24
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,148 @@
1
+ # Solidus Social
2
+
3
+ [![Build Status](https://travis-ci.org/solidusio-contrib/solidus_social.svg?branch=master)](https://travis-ci.org/solidusio-contrib/solidus_social)
4
+ [![Code Climate](https://codeclimate.com/github/solidusio-contrib/solidus_social/badges/gpa.svg)](https://codeclimate.com/github/solidusio-contrib/solidus_social)
5
+
6
+ Core for all social media related functionality for Solidus.
7
+ The Solidus Social gem handles authorization, account creation and association through social media sources such as Twitter and Facebook.
8
+ This gem is beta at best and should be treated as such.
9
+ Features and code base will change rapidly as this is under active development.
10
+ Use with caution.
11
+
12
+ ---
13
+
14
+ ## Setup for Production
15
+
16
+ Add this extension to your `Gemfile`:
17
+ ```ruby
18
+ gem 'solidus_social'
19
+ ```
20
+
21
+ Then run:
22
+ ```sh
23
+ $ bundle && bundle exec rails g solidus_social:install
24
+ $ bundle exec rake db:migrate
25
+ ```
26
+
27
+ Preference(optional): By default url will be '/users/auth/:provider'. If you wish to modify the url to: '/member/auth/:provider', '/profile/auth/:provider', or '/auth/:provider' then you can do this accordingly in your **config/initializers/spree.rb** file as described below -
28
+
29
+ ```ruby
30
+ Spree::SocialConfig[:path_prefix] = 'member' # for /member/auth/:provider
31
+ Spree::SocialConfig[:path_prefix] = 'profile' # for /profile/auth/:provider
32
+ Spree::SocialConfig[:path_prefix] = '' # for /auth/:provider
33
+ ```
34
+
35
+ ---
36
+
37
+ ## Spree Setup to Utilize OAuth Sources
38
+
39
+ Login as an admin user and navigate to Configuration > Social Authentication Methods
40
+
41
+ Click on the New Authentication Method button to enter the key obtained from their respective source, (See below for instructions on setting up the various providers).
42
+
43
+ Multiple key entries can now be entered based on the rails environment. This allows for portability and the lack of need to check in your key to your repository. You also have the ability to enable and disable sources. These setting will be reflected on the client UI as well.
44
+
45
+ Alternatively you can ship keys as environment variables and create these Authentication Method records on application boot via an initializer. Below is an example for facebook.
46
+
47
+ ```ruby
48
+ # Ensure our environment is bootstrapped with a facebook connect app
49
+ if ActiveRecord::Base.connection.table_exists? 'spree_authentication_methods'
50
+ Spree::AuthenticationMethod.where(environment: Rails.env, provider: 'facebook').first_or_create do |auth_method|
51
+ auth_method.api_key = ENV['FACEBOOK_APP_ID']
52
+ auth_method.api_secret = ENV['FACEBOOK_APP_SECRET']
53
+ auth_method.active = true
54
+ end
55
+ end
56
+ ```
57
+
58
+ **You MUST restart your application after configuring or updating an authentication method.**
59
+
60
+ ---
61
+
62
+ ## Setup the Applications at the Respective Sources
63
+
64
+ OAuth Applications @ Facebook, Twitter and / or Github are supported out of the box but you will need to setup applications are each respective site as follows for public use and for development.
65
+
66
+ > All URLs must be in the form of domain.tld you may add a port as well for development
67
+
68
+ ### Facebook
69
+
70
+ [Facebook / Developers / Apps][2]
71
+
72
+ 1. Name the app what you will and agree to the terms.
73
+ 2. Fill out the capcha
74
+ 3. Under the Web Site tab
75
+ 4. Site URL: http://your_computer.local:3000 for development / http://your-site.com for production
76
+ 5. Site domain: your-computer.local / your-site.com respectively
77
+
78
+ ### Twitter
79
+
80
+ [Twitter / Application Management / Create an application][3]
81
+
82
+ 1. Name and Description must be filled in with something
83
+ 2. Application Website: http://your_computer.local:3000 for development / http://your-site.com for production
84
+ 3. Application Type: Browser
85
+ 4. Callback URL: http://your_computer.local:3000 for development / http://your-site.com for production
86
+ 5. Default Access Type: Read & Write
87
+ 6. Save Application
88
+
89
+ ### Github
90
+
91
+ [Github / Applications / Register a new OAuth application][4]
92
+
93
+ 1. Name The Application
94
+ 2. Main URL: http://your_computer.local:3000 for development / http://your-site.com for production
95
+ 3. Callback URL: http://your_computer.local:3000 for development / http://your-site.com for production
96
+ 4. Click Create
97
+
98
+ > This does not seem to be a listed Github item right now. To View and / or edit your applications goto [http://github.com/account/applications](http://github.com/account/applications)
99
+
100
+ ### Amazon
101
+
102
+ [Amazon / App Console / Register a new OAuth application][10]
103
+
104
+ 1. Register New Application
105
+ 2. Name the Application, provide description and URL for Privacy Policy
106
+ 3. Click Save
107
+ 4. Add Your site under Web Settings > Allowed Return URLs (example: http://localhost:3000/users/auth/amazon/callback)
108
+
109
+ > The app console is available at [https://login.amazon.com/manageApps](https://login.amazon.com/manageApps)
110
+
111
+ ### Other OAuth sources that are currently supported
112
+
113
+ * Google (OAuth)
114
+
115
+ ## Adding other OAuth sources
116
+
117
+ It is easy to add any OAuth source, given there is an OmniAuth strategy gem for it (and if not, you can easily [write one by yourself](https://github.com/intridea/omniauth/wiki/Strategy-Contribution-Guide). For instance, if you want to add authorization via LinkedIn, the steps will be:
118
+
119
+ 1. Add `gem "omniauth-linkedin"` to your Gemfile, run `bundle install`.
120
+ 2. In an initializer file, e.g. `config/initializers/devise.rb`, add and init a new provider for SolidusSocial:
121
+
122
+ SolidusSocial::OAUTH_PROVIDERS << ['LinkedIn', 'linkedin']
123
+ SolidusSocial.init_provider('linkedin')
124
+
125
+ 3. Activate your provider as usual (via initializer or admin interface).
126
+ 4. Override `spree/users/social` view to render OAuth links in preferred way for a new one to be displayed. Or alternatively, include to your CSS a definition for `.icon-spree-linkedin-circled` and an embedded icon font for LinkedIn from [fontello.com](http://fontello.com/) (the way existing icons for Facebook, Twitter, etc are implemented). You can also override CSS classes for other providers, `.icon-spree-<provider>-circled`, to use different font icons or classic background images, without having to override views.
127
+
128
+ ---
129
+
130
+ ## Contributing
131
+
132
+ See corresponding [guidelines][11].
133
+
134
+ ---
135
+
136
+ Copyright (c) 2014 [John Dyer][7] and [contributors][8], released under the [New BSD License][9]
137
+
138
+ [1]: https://github.com/spree/spree
139
+ [2]: https://developers.facebook.com/apps/?action=create
140
+ [3]: https://apps.twitter.com/app/new
141
+ [4]: https://github.com/settings/applications/new
142
+ [5]: http://www.fsf.org/licensing/essays/free-sw.html
143
+ [6]: https://github.com/solidusio-contrib/solidus_social/issues
144
+ [7]: https://github.com/LBRapid
145
+ [8]: https://github.com/solidusio-contrib/solidus_social/graphs/contributors
146
+ [9]: https://github.com/solidusio-contrib/solidus_social/blob/master/LICENSE.md
147
+ [10]: https://login.amazon.com/manageApps
148
+ [11]: https://github.com/solidusio-contrib/solidus_social/blob/master/CONTRIBUTING.md
@@ -0,0 +1,15 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
3
+
4
+ require 'rspec/core/rake_task'
5
+ require 'spree/testing_support/common_rake'
6
+
7
+ RSpec::Core::RakeTask.new
8
+
9
+ task default: :spec
10
+
11
+ desc 'Generates a dummy app for testing'
12
+ task :test_app do
13
+ ENV['LIB_NAME'] = 'solidus_social'
14
+ Rake::Task['common:test_app'].invoke('Spree::User')
15
+ end
@@ -0,0 +1 @@
1
+ //= require spree/backend
@@ -0,0 +1 @@
1
+ //= require spree/frontend
@@ -0,0 +1,3 @@
1
+ /*
2
+ *= require spree/backend
3
+ */
@@ -0,0 +1,64 @@
1
+ /**
2
+ * Generated from fontello.com
3
+ * Using Entypo fonts by Daniel Bruce
4
+ * Licenced under CC BY-SA
5
+ *
6
+ * Using embedded fonts for minimal approach.
7
+ * Tweaked icon names to avoid collision.
8
+ * Set 280% font size below per default.
9
+ *
10
+ * Only includes normal and circle icons for:
11
+ * - Facebook
12
+ * - Github
13
+ * - Google+ for Google Oauth2
14
+ * - Twitter
15
+ * - Amazon
16
+ */
17
+
18
+ @font-face {
19
+ font-family: 'fontello';
20
+ src: url('data:application/octet-stream;base64,d09GRgABAAAAABCsAA4AAAAAGqAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABPUy8yAAABRAAAAEQAAABWPihJLmNtYXAAAAGIAAAAOgAAAUrQGRm3Y3Z0IAAAAcQAAAAKAAAACgAAAABmcGdtAAAB0AAABZQAAAtwiJCQWWdhc3AAAAdkAAAACAAAAAgAAAAQZ2x5ZgAAB2wAAAZCAAAH1jI87BtoZWFkAAANsAAAADUAAAA2BD0xCWhoZWEAAA3oAAAAHgAAACQH+wO+aG10eAAADggAAAAfAAAAKCPoAABsb2NhAAAOKAAAABY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BiLLA3Ky6xKwEUKy2wYyywNyuwOystsGQssDcrsDwrLbBlLLAAFrA3K7A9Ky2wZiywOCsusSsBFCstsGcssDgrsDsrLbBoLLA4K7A8Ky2waSywOCuwPSstsGossDkrLrErARQrLbBrLLA5K7A7Ky2wbCywOSuwPCstsG0ssDkrsD0rLbBuLLA6Ky6xKwEUKy2wbyywOiuwOystsHAssDorsDwrLbBxLLA6K7A9Ky2wciyzCQQCA0VYIRsjIVlCK7AIZbADJFB4sAEVMC0AS7gAyFJYsQEBjlmwAbkIAAgAY3CxAAVCsQAAKrEABUKxAAgqsQAFQrEACCqxAAVCuQAAAAkqsQAFQrkAAAAJKrEDAESxJAGIUViwQIhYsQNkRLEmAYhRWLoIgAABBECIY1RYsQMARFlZWVmxAAwquAH/hbAEjbECAEQA') format('truetype');
22
+ }
23
+
24
+
25
+ [class^="icon-spree-"]:before, [class*=" icon-spree-"]:before {
26
+ font-family: "fontello";
27
+ font-style: normal;
28
+ font-weight: normal;
29
+ speak: none;
30
+
31
+ display: inline-block;
32
+ text-decoration: inherit;
33
+ width: 1em;
34
+ margin-right: .2em;
35
+ text-align: center;
36
+ /* opacity: .8; */
37
+
38
+ /* For safety - reset parent styles, that can break glyph codes*/
39
+ font-variant: normal;
40
+ text-transform: none;
41
+
42
+ /* fix buttons height, for twitter bootstrap */
43
+ line-height: 1em;
44
+
45
+ /* Animation center compensation - margins should be symmetric */
46
+ /* remove if not needed */
47
+ margin-left: .2em;
48
+
49
+ /* you can be more comfortable with increased icons size */
50
+ font-size: 280%;
51
+
52
+ /* Uncomment for 3D effect */
53
+ /* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */
54
+ }
55
+ .icon-spree-github:before { content: '\e800'; } /* '' */
56
+ .icon-spree-github-circled:before { content: '\e801'; } /* '' */
57
+ .icon-spree-twitter:before { content: '\e802'; } /* '' */
58
+ .icon-spree-twitter-circled:before { content: '\e803'; } /* '' */
59
+ .icon-spree-facebook:before { content: '\e804'; } /* '' */
60
+ .icon-spree-facebook-circled:before { content: '\e805'; } /* '' */
61
+ .icon-spree-google-oauth2:before { content: '\e806'; } /* '' */
62
+ .icon-spree-google-oauth2-circled:before { content: '\e807'; } /* '' */
63
+ .icon-spree-amazon:before { content: '\e808'; } /* '' */
64
+ .icon-spree-amazon-circled:before { content: '\e808'; } /* '' */
@@ -0,0 +1,4 @@
1
+ /*
2
+ *= require spree/frontend
3
+ *= require_tree .
4
+ */
@@ -0,0 +1,18 @@
1
+ module Spree
2
+ module Admin
3
+ class AuthenticationMethodsController < ResourceController
4
+ create.after :update_oauth_method
5
+ update.after :update_oauth_method
6
+
7
+ private
8
+
9
+ def update_oauth_method
10
+ auth_method = params[:authentication_method]
11
+ return unless auth_method[:active] == 'true' && auth_method[:environment] == ::Rails.env
12
+ Devise.setup do |config|
13
+ config.omniauth auth_method[:provider], auth_method[:api_key], auth_method[:api_secret]
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,67 @@
1
+ class Spree::OmniauthCallbacksController < Devise::OmniauthCallbacksController
2
+ include Spree::Core::ControllerHelpers::Common
3
+ include Spree::Core::ControllerHelpers::Order
4
+ include Spree::Core::ControllerHelpers::Auth
5
+ include Spree::Core::ControllerHelpers::Store
6
+
7
+ def self.provides_callback_for(*providers)
8
+ providers.each do |provider|
9
+ class_eval <<-FUNCTION_DEFS, __FILE__, __LINE__ + 1
10
+ def #{provider}
11
+ if request.env['omniauth.error'].present?
12
+ flash[:error] = I18n.t('devise.omniauth_callbacks.failure', kind: auth_hash['provider'], reason: Spree.t(:user_was_not_valid))
13
+ redirect_back_or_default(root_url)
14
+ return
15
+ end
16
+
17
+ authentication = Spree::UserAuthentication.find_by_provider_and_uid(auth_hash['provider'], auth_hash['uid'])
18
+
19
+ if authentication.present? and authentication.try(:user).present?
20
+ flash[:notice] = I18n.t('devise.omniauth_callbacks.success', kind: auth_hash['provider'])
21
+ sign_in_and_redirect :spree_user, authentication.user
22
+ elsif spree_current_user
23
+ spree_current_user.apply_omniauth(auth_hash)
24
+ spree_current_user.save!
25
+ flash[:notice] = I18n.t('devise.sessions.signed_in')
26
+ redirect_back_or_default(account_url)
27
+ else
28
+ user = Spree::User.find_by_email(auth_hash['info']['email']) || Spree::User.new
29
+ user.apply_omniauth(auth_hash)
30
+ if user.save
31
+ flash[:notice] = I18n.t('devise.omniauth_callbacks.success', kind: auth_hash['provider'])
32
+ sign_in_and_redirect :spree_user, user
33
+ else
34
+ session[:omniauth] = auth_hash.except('extra')
35
+ flash[:notice] = Spree.t(:one_more_step, kind: auth_hash['provider'].capitalize)
36
+ redirect_to new_spree_user_registration_url
37
+ return
38
+ end
39
+ end
40
+
41
+ if current_order
42
+ user = spree_current_user || authentication.user
43
+ current_order.associate_user!(user)
44
+ session[:guest_token] = nil
45
+ end
46
+ end
47
+ FUNCTION_DEFS
48
+ end
49
+ end
50
+
51
+ SolidusSocial::OAUTH_PROVIDERS.each do |provider|
52
+ provides_callback_for provider[1].to_sym
53
+ end
54
+
55
+ def failure
56
+ set_flash_message :alert, :failure, kind: failed_strategy.name.to_s.humanize, reason: failure_message
57
+ redirect_to spree.login_path
58
+ end
59
+
60
+ def passthru
61
+ render file: "#{Rails.root}/public/404", formats: [:html], status: 404, layout: false
62
+ end
63
+
64
+ def auth_hash
65
+ request.env['omniauth.auth']
66
+ end
67
+ end