facebook_digit_auth 0.1.1.pre.beta.pre.9 → 0.1.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 +4 -4
- data/lib/facebook_client.rb +2 -2
- data/lib/facebook_digit_auth/version.rb +1 -1
- data/lib/facebook_digit_auth.rb +4 -7
- metadata +4 -5
- data/lib/digit_client.rb +0 -41
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46a74687754e504a62474d613b47137b3b70fcd3
|
4
|
+
data.tar.gz: d5713f2d87a6d6de007318bf3df1a7a73ee1c35a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e247a3c754766bed2a57828e83b9754e76758012d4f6e3d7d5f1a473d33a7ce6ef00ce93e7dc9cb8dce67e2cb1bd973b2415a071c1ef84f134678c602464bae4
|
7
|
+
data.tar.gz: f6ec1f36805a9126f84594870f0f5cf145d12f8fd33dabc123c5602b83f07263a596972a1653811da33cf45705b776a7e581cc0aecca0908e906af7543aa48c5
|
data/lib/facebook_client.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
class FacebookClient
|
3
2
|
def initialize(token)
|
4
3
|
@client = Koala::Facebook::API.new(token)
|
5
4
|
end
|
@@ -99,6 +98,7 @@
|
|
99
98
|
end
|
100
99
|
|
101
100
|
def profile_picture
|
101
|
+
puts "basic information #{basic_information}"
|
102
102
|
photo_url(basic_information["facebook_user_id"])
|
103
103
|
end
|
104
104
|
|
data/lib/facebook_digit_auth.rb
CHANGED
@@ -1,12 +1,9 @@
|
|
1
1
|
require "facebook_digit_auth/version"
|
2
|
-
module FacebookDigitAuth
|
3
2
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
DigitsClient.new(params).data
|
9
|
-
end
|
3
|
+
module FacebookDigitAuth
|
4
|
+
|
5
|
+
def self.test_method(facebook_user_token)
|
6
|
+
FacebookClient.new(facebook_user_token).data
|
10
7
|
end
|
11
8
|
|
12
9
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: facebook_digit_auth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.1
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- RaghavSingh
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -68,7 +68,6 @@ files:
|
|
68
68
|
- bin/console
|
69
69
|
- bin/setup
|
70
70
|
- facebook_digit_auth.gemspec
|
71
|
-
- lib/digit_client.rb
|
72
71
|
- lib/facebook_client.rb
|
73
72
|
- lib/facebook_digit_auth.rb
|
74
73
|
- lib/facebook_digit_auth/version.rb
|
@@ -87,9 +86,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
87
86
|
version: '0'
|
88
87
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
89
88
|
requirements:
|
90
|
-
- - "
|
89
|
+
- - ">="
|
91
90
|
- !ruby/object:Gem::Version
|
92
|
-
version:
|
91
|
+
version: '0'
|
93
92
|
requirements: []
|
94
93
|
rubyforge_project:
|
95
94
|
rubygems_version: 2.5.1
|
data/lib/digit_client.rb
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
require 'httparty'
|
2
|
-
|
3
|
-
class DigitsClient
|
4
|
-
def initialize(digit_params)
|
5
|
-
@digits_credentials = digit_params
|
6
|
-
@user_id = digit_params[:user_id]
|
7
|
-
@phone_no = digit_params[:number]
|
8
|
-
@auth_token = digit_params[:auth_token]
|
9
|
-
@auth_token_secret = digit_params[:auth_token_secret]
|
10
|
-
@auth_headers = digit_params[:auth_headers]
|
11
|
-
end
|
12
|
-
|
13
|
-
def data
|
14
|
-
if verified
|
15
|
-
{result: true,data: response}
|
16
|
-
else
|
17
|
-
{result: false,message: "Wrong credentials supplied!"}
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
def response
|
22
|
-
HTTParty.get(url, :headers => header)
|
23
|
-
end
|
24
|
-
|
25
|
-
def verified
|
26
|
-
if response["phone_number"] != @phone_no || response["id_str"] != @user_id response["access_token"]["token"] != @auth_token || response["access_token"]["secret"] != @auth_token_secret
|
27
|
-
false
|
28
|
-
else
|
29
|
-
true
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
def header
|
34
|
-
{"Authorization" => @auth_headers['X-Verify-Credentials-Authorization']}
|
35
|
-
end
|
36
|
-
|
37
|
-
def url
|
38
|
-
@auth_headers["X-Auth-Service-Provider"]
|
39
|
-
end
|
40
|
-
|
41
|
-
end
|