ishapi 0.1.8.87 → 0.1.8.91
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/ishapi/application_controller.rb +18 -6
- 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: 6090b8444ccdbb4ea1907531391aa20d64e3136062cb6a1351629ec336698a0d
|
4
|
+
data.tar.gz: 050c632b87dd6c9c2b34e3adb953b966a43578b328e2dc0c85928b4de2035c46
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99efbb472c664f58ed0bbed15413b2660bb36c27ee5c26e816ec001b934f648772a871957f2ea5d908f1673baeedbf2aba4efa59a866e7fe1a0583ae18d490bc
|
7
|
+
data.tar.gz: 217f51c6559aaf30a05161e29d2a95929b1883e47993623c5e05507f9fe8f45f5a91c7db6323b8c46b14585b8a3bf48b531e4259f0406bb3ae4ee7a8a12107af
|
@@ -3,7 +3,7 @@ module Ishapi
|
|
3
3
|
protect_from_forgery :prepend => true, :with => :exception
|
4
4
|
layout :false
|
5
5
|
|
6
|
-
before_action :check_profile, except: [ :test ]
|
6
|
+
# before_action :check_profile, except: [ :test ]
|
7
7
|
# before_action :set_current_ability
|
8
8
|
|
9
9
|
check_authorization
|
@@ -18,7 +18,7 @@ module Ishapi
|
|
18
18
|
private
|
19
19
|
|
20
20
|
def check_multiprofile provider = 'google'
|
21
|
-
if
|
21
|
+
if 'google' == provider
|
22
22
|
# client_secrets = ::Google::APIClient::ClientSecrets.load
|
23
23
|
# accessToken = params[:accessToken]
|
24
24
|
# authorization = ::Google::Auth.get_application_default
|
@@ -28,17 +28,29 @@ module Ishapi
|
|
28
28
|
decoded_token = JWT.decode params[:idToken], nil, false
|
29
29
|
|
30
30
|
@current_user = User.find_by email: decoded_token[0]['email']
|
31
|
-
# puts! @current_user.email, 'multiprofile'
|
32
31
|
|
33
|
-
|
34
|
-
|
32
|
+
elsif 'facebook' == provider
|
33
|
+
accessToken = request.headers[:accessToken]
|
34
|
+
accessToken ||= params[:fb_long_access_token]
|
35
|
+
accessToken ||= params[:accessToken]
|
36
|
+
if accessToken
|
37
|
+
@graph = Koala::Facebook::API.new( accessToken )
|
38
|
+
@me = @graph.get_object( 'me', :fields => 'email' )
|
39
|
+
@current_user = User.find_by :email => @me['email']
|
40
|
+
else
|
41
|
+
@current_user = current_user if Rails.env.test?
|
42
|
+
end
|
35
43
|
end
|
44
|
+
|
45
|
+
sign_in @current_user, scope: :user
|
46
|
+
set_current_ability
|
36
47
|
end
|
37
48
|
|
38
49
|
# this doesn't generate long-lived token, doesn't update user_profile
|
39
50
|
# this is only for facebook?
|
40
51
|
def check_profile
|
41
|
-
return check_multiprofile 'google'
|
52
|
+
# return check_multiprofile 'google'
|
53
|
+
return check_multiprofile 'facebook'
|
42
54
|
|
43
55
|
# puts! params, 'params'
|
44
56
|
# puts! current_user, 'current_user'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ishapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.8.
|
4
|
+
version: 0.1.8.91
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- piousbox
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-04-
|
11
|
+
date: 2019-04-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|