wcc-auth 0.7.2 → 0.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6bc56638e90e9493a8597d939bf7e900144778c1
4
- data.tar.gz: 22521e91a15775f883d3b62d646022f6db62b585
3
+ metadata.gz: 30cefb293a49a140ccb55259ec4b21847846a38e
4
+ data.tar.gz: 2afe1e95678a63aa1691633148f6f365ea928e47
5
5
  SHA512:
6
- metadata.gz: 94534a55209d7f2878cefea1304ee72c120f393bdb4b369dec603cf2772c134fdd07737081aca520fc9fdc4ffe9aee0e5b4e36cd9f011409ab0379a6b89cd3ad
7
- data.tar.gz: 938bde42ae68c3d0cc56c3e626124cc2c9f54be8e4c92887d66a23f96f72d79e56d561d5b546438908a3101bdf65e03c8c247d363a74430e562710aa5bbf26af
6
+ metadata.gz: ed9d8da4a6e92b04975ec4a77c7a0c248c75648a980c18ffde275b33bc97cee60fca4ceb471910c9f2c73ee40f456b8f3a0a2e602557d73d755b09d4a06af3e6
7
+ data.tar.gz: 820d51c3779ea249bfe8a6fb3f31aa6e4e460a0a482cbed6c55d31371672724f70584b8bca6434057f8c7111f38a61af8f85be25b8b6eceaee464ac952f30313
@@ -1,22 +1,37 @@
1
- require "wcc/auth"
2
- require "devise"
1
+ # frozen_string_literal: true
2
+
3
+ require 'wcc/auth'
4
+ require 'devise'
3
5
 
4
6
  module WCC
5
7
  module Auth
6
8
  module Devise
7
- autoload :WatermarkCallbacksController, 'wcc/auth/devise/watermark_callbacks_controller'
9
+ autoload :WatermarkCallbacksController,
10
+ 'wcc/auth/devise/watermark_callbacks_controller'
8
11
  end
12
+
13
+ SetupOAuth = lambda { |env|
14
+ request = Rack::Request.new(env)
15
+
16
+ env['omniauth.strategy'].options[:client_id] = config.app_id
17
+ env['omniauth.strategy'].options[:client_secret] = config.app_secret
18
+ auth_params = config.authorize_params.merge(
19
+ request.params['authorize_params'] || {}
20
+ )
21
+
22
+ auth_params.each do |k, v|
23
+ env['omniauth.strategy'].options[:authorize_params][k] = v
24
+ end
25
+ }
9
26
  end
10
27
  end
11
28
 
12
- WCC::Auth.finalize_callbacks << -> {
13
- require "omniauth/strategies/watermark"
29
+ WCC::Auth.finalize_callbacks << lambda {
30
+ require 'omniauth/strategies/watermark'
31
+
14
32
  Devise.setup do |config|
15
- config.omniauth :watermark,
16
- WCC::Auth.config.app_id,
17
- WCC::Auth.config.app_secret
33
+ config.omniauth :watermark, setup: WCC::Auth::SetupOAuth
18
34
  end
19
35
 
20
36
  OmniAuth.config.full_host = WCC::Auth.config.app_url
21
37
  }
22
-
@@ -1,5 +1,5 @@
1
1
  module WCC
2
2
  module Auth
3
- VERSION = '0.7.2'.freeze
3
+ VERSION = '0.7.3'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wcc-auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Watermark Dev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-14 00:00:00.000000000 Z
11
+ date: 2020-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cancancan