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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/omniauth/strategies/webflow.rb +17 -16
- data/lib/omniauth-webflow/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ad987f587504fabb5720eaa3477450f4670cf147e98b5fb9daaf104250e7823
|
4
|
+
data.tar.gz: 4e6d2c5c10ff603dd00fc10fc4708510cc6b94ddc5c7948ffb381913b0569245
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4dc8f3bf741a1a3c153e95ebaf740e33d544d8a4e7e3e24d98e92a6b17221200ad44f851a5f08dc67f6eaa16683f33c2542e8f59fc18bc01791436c4a2de5d89
|
7
|
+
data.tar.gz: fc3d3ec53a6486a2bfbef7ace67e037bdc97db38ec72f9055ba5ae4c7240b50ccd8f09eb2c3e3d7270fc67fb24c4d91468e9bb7861a45a07a8bf001411579993
|
data/Gemfile.lock
CHANGED
@@ -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 =
|
6
|
+
API_VERSION = '1.0.0'.freeze
|
7
7
|
|
8
|
-
option :name,
|
8
|
+
option :name, 'webflow'
|
9
9
|
option :client_options, {
|
10
|
-
site:
|
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[
|
22
|
-
grant_type: raw_info[
|
23
|
-
users: raw_info[
|
24
|
-
orgs: raw_info[
|
25
|
-
sites: raw_info[
|
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
|
-
|
37
|
+
protected
|
40
38
|
|
41
|
-
#
|
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[
|
44
|
-
|
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
|
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.
|
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:
|
11
|
+
date: 2022-09-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth-oauth2
|