omniauth-webflow 0.1.1 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cdeb0c0b2d3116f3845630ec72d36f3a2bd2b3c33a612772dd64a8b63f693d32
4
- data.tar.gz: ba32be657fe24a8a1b7f0ccd9069f34d2794e68b7ca6046c7fe31ddbc779f7ce
3
+ metadata.gz: 4ad987f587504fabb5720eaa3477450f4670cf147e98b5fb9daaf104250e7823
4
+ data.tar.gz: 4e6d2c5c10ff603dd00fc10fc4708510cc6b94ddc5c7948ffb381913b0569245
5
5
  SHA512:
6
- metadata.gz: ab958103ab845e0f37fa8ca049be7a0e352f5770129bb1d8b73b3cc3df08191fc3e7af01672d1bb66cf692eed12c44a07b0ded78be02393fab1f264c13a7da40
7
- data.tar.gz: 65294855f9c5ee1b2376e9df6eb84158ba28b8c5f3e1722a7d8ab78c15b1b33b67be4def9b95771a515e294a8cdd8184f55c3c667bd021da7841bb90ffb91b30
6
+ metadata.gz: 4dc8f3bf741a1a3c153e95ebaf740e33d544d8a4e7e3e24d98e92a6b17221200ad44f851a5f08dc67f6eaa16683f33c2542e8f59fc18bc01791436c4a2de5d89
7
+ data.tar.gz: fc3d3ec53a6486a2bfbef7ace67e037bdc97db38ec72f9055ba5ae4c7240b50ccd8f09eb2c3e3d7270fc67fb24c4d91468e9bb7861a45a07a8bf001411579993
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- omniauth-webflow (0.1.1)
4
+ omniauth-webflow (0.2.1)
5
5
  multi_json (~> 1.15)
6
6
  omniauth-oauth2 (~> 1.7)
7
7
 
@@ -3,26 +3,24 @@ require 'omniauth-oauth2'
3
3
  module OmniAuth
4
4
  module Strategies
5
5
  class Webflow < OmniAuth::Strategies::OAuth2
6
- API_VERSION = "1.0.0"
6
+ API_VERSION = '1.0.0'.freeze
7
7
 
8
- option :name, "webflow"
8
+ option :name, 'webflow'
9
9
  option :client_options, {
10
- site: "https://api.webflow.com",
10
+ site: 'https://api.webflow.com',
11
11
  authorize_url: 'https://webflow.com/oauth/authorize',
12
12
  token_url: 'https://api.webflow.com/oauth/access_token'
13
13
  }
14
- # option :token_params, { parse: :json }
15
- # option :auth_token_params, { mode: :query, param_name: :token }
16
14
 
17
15
  uid { raw_info['_id'] }
18
16
 
19
17
  info do
20
18
  {
21
- id: raw_info["_id"],
22
- grant_type: raw_info["grantType"],
23
- users: raw_info["users"],
24
- orgs: raw_info["orgs"],
25
- sites: raw_info["sites"],
19
+ id: raw_info['_id'],
20
+ grant_type: raw_info['grantType'],
21
+ users: raw_info['users'],
22
+ orgs: raw_info['orgs'],
23
+ sites: raw_info['sites']
26
24
  }
27
25
  end
28
26
 
@@ -36,14 +34,17 @@ module OmniAuth
36
34
  @raw_info ||= access_token.get("https://api.webflow.com/info?api_version=#{API_VERSION}").parsed
37
35
  end
38
36
 
39
- protected
37
+ protected
40
38
 
41
- # had to override this method as it was merging the redirect_uri into the params which was breaking the Webflow /access_token request
39
+ # callback_url includes the code parameter and Webflow decided to change their API recently
40
+ # to require the redirect_uri to match exactly what you have in your Webflow Application settings.
41
+ # This also means that you can not pass other url parameters through the redirect_uri.
42
42
  def build_access_token
43
- verifier = request.params["code"]
44
- client.auth_code.get_token(verifier, token_params.to_hash(:symbolize_keys => true), deep_symbolize(options.auth_token_params))
43
+ verifier = request.params['code']
44
+ uri = Addressable::URI.parse(callback_url)
45
+ redirect_uri = uri.omit(:query).to_s
46
+ client.auth_code.get_token(verifier, { redirect_uri: redirect_uri }.merge(token_params.to_hash(symbolize_keys: true)), deep_symbolize(options.auth_token_params))
45
47
  end
46
-
47
48
  end
48
49
  end
49
- end
50
+ end
@@ -1,5 +1,5 @@
1
1
  module Omniauth
2
2
  module Webflow
3
- VERSION = '0.1.1'.freeze
3
+ VERSION = '0.2.1'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-webflow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-11-15 00:00:00.000000000 Z
11
+ date: 2022-09-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth-oauth2