ishapi 0.1.8.192 → 0.1.8.194
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: 59e8e484d3741e6599d8d8397cfad5dd499635f956c92ed0ed9265172ea30e73
|
4
|
+
data.tar.gz: 5a1c6b3c8a307cf402167ced6ae4280d943f26c2791848e7cf084a7cee336c24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7dba64e22efac66fc5167e3d9dfbca15572adfdf0d867f0abe74ab464fbae30020eae2038b59e52b48f2826f66dedd08bc0680c7a6e42eddfc80cd6729eee92
|
7
|
+
data.tar.gz: 7eaaccd91a551e98134431730f4cdee21f85bc580d9d7953054a9bb7abc2b9351418de9a32e3ed9bcce5eeca901c2882419f7b5f83957ff479eddf0758584365
|
@@ -19,7 +19,7 @@ class Ishapi::ApplicationController < ActionController::Base
|
|
19
19
|
@long_term_token = j['access_token']
|
20
20
|
@graph = Koala::Facebook::API.new( accessToken )
|
21
21
|
@me = @graph.get_object( 'me', :fields => 'email' )
|
22
|
-
@current_user =
|
22
|
+
@current_user = TmpUser.where( :email => @me['email'] ).first
|
23
23
|
|
24
24
|
# send the jwt to client
|
25
25
|
@jwt_token = encode(user_id: @current_user.id.to_s)
|
@@ -64,7 +64,7 @@ class Ishapi::ApplicationController < ActionController::Base
|
|
64
64
|
rescue JWT::ExpiredSignature, JWT::DecodeError => e
|
65
65
|
# flash[:notice] = 'You are not logged in, or you have been logged out.'
|
66
66
|
# puts! 'You are not logged in, or you have been logged out.'
|
67
|
-
@current_user =
|
67
|
+
@current_user = TmpUser.new({ profile: Ish::UserProfile.new })
|
68
68
|
end
|
69
69
|
end
|
70
70
|
|
@@ -72,7 +72,7 @@ class Ishapi::ApplicationController < ActionController::Base
|
|
72
72
|
def check_profile_hard
|
73
73
|
begin
|
74
74
|
decoded = decode(params[:jwt_token])
|
75
|
-
@current_user =
|
75
|
+
@current_user = TmpUser.find decoded['user_id']
|
76
76
|
rescue JWT::ExpiredSignature, JWT::DecodeError => e
|
77
77
|
# flash[:notice] = 'You are not logged in, or you have been logged out.'
|
78
78
|
# puts! 'You are not logged in, or you have been logged out.'
|
@@ -83,7 +83,7 @@ class Ishapi::ApplicationController < ActionController::Base
|
|
83
83
|
def check_jwt
|
84
84
|
begin
|
85
85
|
decoded = decode(params[:jwt_token])
|
86
|
-
@current_user =
|
86
|
+
@current_user = TmpUser.find decoded['user_id']
|
87
87
|
rescue JWT::ExpiredSignature
|
88
88
|
Rails.logger.info("JWT::ExpiredSignature")
|
89
89
|
rescue JWT::DecodeError
|
@@ -0,0 +1,49 @@
|
|
1
|
+
|
2
|
+
#
|
3
|
+
# only devise!
|
4
|
+
#
|
5
|
+
class TmpUser
|
6
|
+
include Mongoid::Document
|
7
|
+
include Mongoid::Timestamps
|
8
|
+
|
9
|
+
has_one :profile, :class_name => '::Ish::UserProfile'
|
10
|
+
|
11
|
+
# Include default devise modules. Others available are:
|
12
|
+
# :confirmable, :lockable, :timeoutable and :omniauthable
|
13
|
+
# devise :database_authenticatable, :registerable,
|
14
|
+
# :recoverable, :rememberable, :trackable, :validatable,
|
15
|
+
# :confirmable
|
16
|
+
|
17
|
+
## Database authenticatable
|
18
|
+
field :email, type: String, default: ""
|
19
|
+
index({ email: 1 })
|
20
|
+
|
21
|
+
field :encrypted_password, type: String, default: ""
|
22
|
+
|
23
|
+
alias will_save_change_to_email? email_changed?
|
24
|
+
|
25
|
+
## Recoverable
|
26
|
+
field :reset_password_token, type: String
|
27
|
+
field :reset_password_sent_at, type: Time
|
28
|
+
|
29
|
+
## Rememberable
|
30
|
+
field :remember_created_at, type: Time
|
31
|
+
|
32
|
+
## Trackable
|
33
|
+
field :sign_in_count, type: Integer, default: 0
|
34
|
+
field :current_sign_in_at, type: Time
|
35
|
+
field :last_sign_in_at, type: Time
|
36
|
+
field :current_sign_in_ip, type: String
|
37
|
+
field :last_sign_in_ip, type: String
|
38
|
+
|
39
|
+
## Confirmable
|
40
|
+
field :confirmation_token, type: String
|
41
|
+
field :confirmed_at, type: Time
|
42
|
+
field :confirmation_sent_at, type: Time
|
43
|
+
field :unconfirmed_email, type: String # Only if using reconfirmable
|
44
|
+
|
45
|
+
## Lockable
|
46
|
+
# field :failed_attempts, type: Integer, default: 0 # Only if lock strategy is :failed_attempts
|
47
|
+
# field :unlock_token, type: String # Only if unlock strategy is :email or :both
|
48
|
+
# field :locked_at, type: Time
|
49
|
+
end
|
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.194
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- piousbox
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-10-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -298,6 +298,7 @@ files:
|
|
298
298
|
- app/mailers/ishapi/application_mailer.rb
|
299
299
|
- app/mailers/ishapi/confirmations_mailer.rb
|
300
300
|
- app/models/ishapi/ability.rb
|
301
|
+
- app/models/tmp_user.rb
|
301
302
|
- app/views/ishapi/addresses/_show.jbuilder
|
302
303
|
- app/views/ishapi/application/_meta.jbuilder
|
303
304
|
- app/views/ishapi/application/_pagination.jbuilder
|