facebook_digit_auth 3.0.0 → 3.0.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
  SHA1:
3
- metadata.gz: 20418bb515b50b16785ec8a4b06f94187848e2f9
4
- data.tar.gz: 3c5575d0e91cba2c0be06cf0a07a1cd93376abf7
3
+ metadata.gz: 42b4e945aec72d30879dd99f90505b085b143e99
4
+ data.tar.gz: 879edad2cb8a7f97ae5845e44ef173b84e7ea298
5
5
  SHA512:
6
- metadata.gz: b68ae79a9f361521953263de9e43543398fe52040cf2828a3aa71129111156cff7111704c9c8a54eb998e1c62d3dc103592beb4735f7e380eb6beb45dea3017f
7
- data.tar.gz: 9890b1454fc1038842b2a10b01a5dbd6e50b7a362252d936add5f76135516267c3ca5a9965d0aa964d14c041ba1f1c67e014ebd369049f64a135c10b390c9d52
6
+ metadata.gz: 5d010e45b614182295f70a290581f785615ad7d8d6796b03553c1f42825564d1c5421fce205d267d794bc0bebcfbbdeeebbad59b425f8aa0afe483de279f6c13
7
+ data.tar.gz: 5e978b420ef235b15d81cd65a5a3f5a15b97392ad8ed45dedf1bebef10ac2bd31628d8c645e89a7e808511391e608f87132ee47148f3321b05fbef98ecf5ccd7
@@ -1,3 +1,3 @@
1
1
  module FacebookDigitAuth
2
- VERSION = "3.0.0"
2
+ VERSION = "3.0.1"
3
3
  end
@@ -0,0 +1,32 @@
1
+ class GoogleAuth
2
+
3
+ def initialize(auth_token)
4
+ @auth_token = auth_token
5
+ end
6
+
7
+ def data
8
+ @user_info = HTTParty.get(url,:headers => header)
9
+ if @user_info.body.present?
10
+ body = JSON.parse(@user_info.body)
11
+ if body["error"].present?
12
+ error = body["error"]["errors"]
13
+ {:code => body["error"]["code"] , :error => error}
14
+ else
15
+ {:code => 200, :data => body}
16
+ end
17
+ else
18
+ {:code => 422 , :error => "Something went wrong"}
19
+ end
20
+ end
21
+
22
+ private
23
+
24
+ def header
25
+ {"Authorization" => "OAuth #{@auth_token}"}
26
+ end
27
+
28
+ def url
29
+ "https://www.googleapis.com/oauth2/v2/userinfo"
30
+ end
31
+
32
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: facebook_digit_auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - RaghavSingh
@@ -100,6 +100,7 @@ files:
100
100
  - lib/facebook_client.rb
101
101
  - lib/facebook_digit_auth.rb
102
102
  - lib/facebook_digit_auth/version.rb
103
+ - lib/google_auth.rb
103
104
  homepage: https://github.com/RaghavVishnoi/test_gem.git
104
105
  licenses:
105
106
  - MIT