stbaldricks 4.4.0.alpha.5 → 4.4.0.beta.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: cf1899831d2916f4089752bb0cbc58106a17f89f663081a687bac5a4ad98683d
4
- data.tar.gz: a9ebb3f04ad6ec5009393190ece61e8340e33c2e085901789c605a6bb32b6673
3
+ metadata.gz: 8f02b9391aa6707f27a383585bad6d5a80596f938caf9943f8b75d9597700004
4
+ data.tar.gz: b88e6ba18647f147f915bf5e71af8e79b1f356804ae6bfcb49b833382dec22aa
5
5
  SHA512:
6
- metadata.gz: b23ba1a46e189b9d3c1d8f03c2cddcfdf715647e642cf08be74f55b50bb84e717fdb6a942e090068e1916b24109f03572b05d88759c993eb1b53e9f13c47ab15
7
- data.tar.gz: 5c6f6ad7191962679ffcfa384c348f4e0d14dba523d641310621521ae98ecb24b9eb851758eaff0dac7d8e8a5779546338306af4f3096784eecdb26c653eefea
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
- if ok?(response)
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)
@@ -0,0 +1,12 @@
1
+ require 'stbaldricks/entities/user'
2
+ require 'stbaldricks/endpoints/facebook/user'
3
+
4
+ module SBF
5
+ module Client
6
+ module Facebook
7
+ class User < SBF::Client::User
8
+ endpoint SBF::Client::Facebook::UserEndpoint
9
+ end
10
+ end
11
+ end
12
+ end
@@ -1,5 +1,5 @@
1
1
  module SBF
2
2
  module Client
3
- VERSION = '4.4.0.alpha.5'
3
+ VERSION = '4.4.0.beta.1'
4
4
  end
5
5
  end
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.alpha.5
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-24 00:00:00.000000000 Z
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