ishapi 0.1.8.193 → 0.1.8.194

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: 5a47b5f35074c42413ee23881593fee9f0485f08779b8f6edd325427ba7c715c
4
- data.tar.gz: 81a752abc6ce917ad10fc4c5ee53ad38cf213e4ee387be67f169c173062dd7ea
3
+ metadata.gz: 59e8e484d3741e6599d8d8397cfad5dd499635f956c92ed0ed9265172ea30e73
4
+ data.tar.gz: 5a1c6b3c8a307cf402167ced6ae4280d943f26c2791848e7cf084a7cee336c24
5
5
  SHA512:
6
- metadata.gz: c39803bf360ca1049ba8e4e807c49f81753397bdac98ace82ee3e9e194f8ddbbff502e362f9a206ebe777dfa34939c3ec14883e436abdbd4a56fb8593b08641a
7
- data.tar.gz: 1931faec9c939dfd7663fc60849b804b7e68ec42127f565fb1a6103eec2e45163c25cb7a8e2f075f55faa69b29cf021c89a7934ea7e5c0144404e9fdb1c84bc2
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 = User.where( :email => @me['email'] ).first
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 = User.new({ profile: Ish::UserProfile.new })
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 = User.find decoded['user_id']
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 = User.find decoded['user_id']
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,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ishapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8.193
4
+ version: 0.1.8.194
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
@@ -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