standard_id 0.18.0 → 0.19.0
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
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3d3af31455bcc5b445cb7398d0d4bc2d4fac8ee7e246bcdc437796419af80284
|
|
4
|
+
data.tar.gz: 167ef5777acbc1de9bf7ecbb9d9e30f95597094566b6268f48c56d1d462c8d37
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 68bf2f44b3791c46a08500da1c2c91e0878c4b7b009a810fc761d450aeffdc5c007bf2ecef3e2b1a1193ad09313aac528489925215ec7cb23bdbbdef8df4d3c3
|
|
7
|
+
data.tar.gz: d5116af139011d0cc8d5955489f751bf3dc8592e5e5474b55ce62178add8d828041e952f272a79a52adf7e20238dac02cadd22a8faa28b49277d789320b5897f
|
|
@@ -8,6 +8,16 @@ module StandardId
|
|
|
8
8
|
|
|
9
9
|
skip_before_action :validate_content_type!
|
|
10
10
|
|
|
11
|
+
# OAuth-flow params consumed by this controller and the SocialFlow.
|
|
12
|
+
# Everything else is forwarded to SOCIAL_AUTH_COMPLETED subscribers as
|
|
13
|
+
# `original_request_params` so host apps can attach attribution
|
|
14
|
+
# (UTM, campaign IDs, deep-link slugs) to the signing-in account.
|
|
15
|
+
RESERVED_CALLBACK_PARAMS = %w[
|
|
16
|
+
id_token code scope scopes audience redirect_uri flow
|
|
17
|
+
state nonce provider controller action format
|
|
18
|
+
authenticity_token utf8 _method
|
|
19
|
+
].freeze
|
|
20
|
+
|
|
11
21
|
def callback
|
|
12
22
|
provider_response = get_user_info_from_provider(flow: resolve_flow_for(provider.provider_name))
|
|
13
23
|
social_info = provider_response[:user_info]
|
|
@@ -28,6 +38,7 @@ module StandardId
|
|
|
28
38
|
social_info:,
|
|
29
39
|
provider_tokens:,
|
|
30
40
|
account:,
|
|
41
|
+
original_request_params: forwarded_request_params
|
|
31
42
|
)
|
|
32
43
|
render json: token_response, status: :ok
|
|
33
44
|
end
|
|
@@ -40,6 +51,12 @@ module StandardId
|
|
|
40
51
|
flow_param = params[:flow].to_s.downcase
|
|
41
52
|
flow_param == "web" ? :web : :mobile
|
|
42
53
|
end
|
|
54
|
+
|
|
55
|
+
# The `except` list is the trust boundary — non-reserved values are
|
|
56
|
+
# host-supplied opaque attribution data, never interpreted by the gem.
|
|
57
|
+
def forwarded_request_params
|
|
58
|
+
params.to_unsafe_h.stringify_keys.except(*RESERVED_CALLBACK_PARAMS)
|
|
59
|
+
end
|
|
43
60
|
end
|
|
44
61
|
end
|
|
45
62
|
end
|
data/lib/standard_id/version.rb
CHANGED