stbaldricks 4.4.0.beta.1 → 4.4.0.beta.2
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 +4 -4
- data/lib/stbaldricks/endpoints/facebook/user.rb +10 -7
- data/lib/stbaldricks/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: 98e4df5d803ed719c1f86f1ab19f50f6f02f8f0012cb2e4163e001997b19944a
|
4
|
+
data.tar.gz: 354d7b88af1cdc39ce1cc60d7d0d9add811e9bbba83b226ba306f28cf656defe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f519962bee5e3aff8b96626846385d74ccd2ac611f9cb87b2d75cbfdbcab2c4d00d0c75f66a05d3a20ad60a96b6700db7fd1b49a46ad45ee6e2630fd85f33093
|
7
|
+
data.tar.gz: cc2d12cee5823456f503abdbff2d0f733173fc785587c87ca4582be656bb73b43bea548005b0cfa999d421912fcf48ee0ba8a41f58c2245020f68dac57c40126
|
@@ -4,30 +4,33 @@ module SBF
|
|
4
4
|
module Client
|
5
5
|
module Facebook
|
6
6
|
class UserEndpoint < SBF::Client::UserEndpoint
|
7
|
-
# Logs in a user, using
|
7
|
+
# Logs in a user, using a Facebook Oauth authorization code & redirect uri.
|
8
|
+
# Configures the client library to use user credentials for subsequent requests.
|
8
9
|
# Returns the SBF access token for the user that should be held onto to configure the client library in
|
9
10
|
# future requests that are outside of this scope.
|
10
11
|
#
|
11
|
-
# @param
|
12
|
-
# @param
|
12
|
+
# @param authorization_code [string]
|
13
|
+
# @param redirect_uri [string]
|
13
14
|
# @return [string]
|
14
|
-
def login!(
|
15
|
+
def login!(authorization_code, redirect_uri)
|
15
16
|
response = SBF::Client::Api::Request.post_request(
|
16
17
|
"/#{SBF::Client::Api::VERSION}/security/facebook/login",
|
17
|
-
|
18
|
-
|
18
|
+
authorization_code: authorization_code,
|
19
|
+
redirect_uri: redirect_uri
|
19
20
|
)
|
20
21
|
parsed_response = JSON.parse(response.body).symbolize!
|
21
22
|
|
22
23
|
if ok?(response)
|
23
24
|
SBF::Client::Configuration.user_token = parsed_response[:token]
|
24
25
|
data = parsed_response.merge(user: target_class.new(parsed_response[:user]))
|
26
|
+
SBF::Client::LOG.info {
|
27
|
+
"SBF::Client - Facebook User Login with Identifier: #{parsed_response[:user][:identifier]}, SBF Token: #{parsed_response[:token]}"
|
28
|
+
}
|
25
29
|
else
|
26
30
|
SBF::Client::Configuration.user_token = nil
|
27
31
|
error = SBF::Client::ErrorEntity.new(parsed_response)
|
28
32
|
end
|
29
33
|
|
30
|
-
SBF::Client::LOG.info { "SBF::Client - Facebook User Login with Identifier: #{identifier}, SBF Token: #{parsed_response[:token]}" }
|
31
34
|
SBF::Client::Api::Response.new(http_code: response.code, data: data, error: error)
|
32
35
|
end
|
33
36
|
end
|
data/lib/stbaldricks/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stbaldricks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.4.0.beta.
|
4
|
+
version: 4.4.0.beta.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Firespring
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-01
|
11
|
+
date: 2018-02-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|