stbaldricks 4.4.0.alpha.5 → 4.4.0.beta.1
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: 8f02b9391aa6707f27a383585bad6d5a80596f938caf9943f8b75d9597700004
|
4
|
+
data.tar.gz: b88e6ba18647f147f915bf5e71af8e79b1f356804ae6bfcb49b833382dec22aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54d50fc596b7ef1b7a4ba0dbaf40689a04b5a37401b583941bcbc3c0de685a0350de71127a837d21b0ba8915091a866a769521a4c4b914262af77040d478fab4
|
7
|
+
data.tar.gz: 98ec20f28fe97e545de8f30928e7000d20008c11d93d2b8210877f732d704993ed69da77c3cd22eb62eb180ebaaf638746421205624ab9cb4b8ad4478651a4b9
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'stbaldricks/endpoints/user'
|
2
|
+
|
3
|
+
module SBF
|
4
|
+
module Client
|
5
|
+
module Facebook
|
6
|
+
class UserEndpoint < SBF::Client::UserEndpoint
|
7
|
+
# Logs in a user, using their Facebook identifier & token, and configures the client library to use user credentials for subsequent requests.
|
8
|
+
# Returns the SBF access token for the user that should be held onto to configure the client library in
|
9
|
+
# future requests that are outside of this scope.
|
10
|
+
#
|
11
|
+
# @param identifier [string]
|
12
|
+
# @param token [string]
|
13
|
+
# @return [string]
|
14
|
+
def login!(identifier, token)
|
15
|
+
response = SBF::Client::Api::Request.post_request(
|
16
|
+
"/#{SBF::Client::Api::VERSION}/security/facebook/login",
|
17
|
+
identifier: identifier,
|
18
|
+
token: token
|
19
|
+
)
|
20
|
+
parsed_response = JSON.parse(response.body).symbolize!
|
21
|
+
|
22
|
+
if ok?(response)
|
23
|
+
SBF::Client::Configuration.user_token = parsed_response[:token]
|
24
|
+
data = parsed_response.merge(user: target_class.new(parsed_response[:user]))
|
25
|
+
else
|
26
|
+
SBF::Client::Configuration.user_token = nil
|
27
|
+
error = SBF::Client::ErrorEntity.new(parsed_response)
|
28
|
+
end
|
29
|
+
|
30
|
+
SBF::Client::LOG.info { "SBF::Client - Facebook User Login with Identifier: #{identifier}, SBF Token: #{parsed_response[:token]}" }
|
31
|
+
SBF::Client::Api::Response.new(http_code: response.code, data: data, error: error)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -67,13 +67,11 @@ module SBF
|
|
67
67
|
password: password
|
68
68
|
)
|
69
69
|
|
70
|
-
|
71
|
-
SBF::Client::Configuration.user_token = nil
|
72
|
-
else
|
73
|
-
SBF::Client::Configuration.user_token = nil
|
70
|
+
unless ok?(response)
|
74
71
|
parsed_response = JSON.parse(response.body).symbolize!
|
75
72
|
error = SBF::Client::ErrorEntity.new(parsed_response)
|
76
73
|
end
|
74
|
+
SBF::Client::Configuration.user_token = nil
|
77
75
|
|
78
76
|
SBF::Client::LOG.info { "SB::Client - Change Password for user with profile_id: #{profile_id}" }
|
79
77
|
SBF::Client::Api::Response.new(http_code: response.code, data: nil, error: error)
|
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.
|
4
|
+
version: 4.4.0.beta.1
|
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-01-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -85,6 +85,7 @@ files:
|
|
85
85
|
- lib/stbaldricks/endpoints/contact.rb
|
86
86
|
- lib/stbaldricks/endpoints/event.rb
|
87
87
|
- lib/stbaldricks/endpoints/event_application.rb
|
88
|
+
- lib/stbaldricks/endpoints/facebook/user.rb
|
88
89
|
- lib/stbaldricks/endpoints/fund.rb
|
89
90
|
- lib/stbaldricks/endpoints/kid.rb
|
90
91
|
- lib/stbaldricks/endpoints/kid_honor.rb
|
@@ -138,6 +139,7 @@ files:
|
|
138
139
|
- lib/stbaldricks/entities/event_donation_summary.rb
|
139
140
|
- lib/stbaldricks/entities/event_participant_summary.rb
|
140
141
|
- lib/stbaldricks/entities/event_supporter.rb
|
142
|
+
- lib/stbaldricks/entities/facebook/user.rb
|
141
143
|
- lib/stbaldricks/entities/fund.rb
|
142
144
|
- lib/stbaldricks/entities/fundraiser.rb
|
143
145
|
- lib/stbaldricks/entities/grant.rb
|