ishapi 0.1.8.138 → 0.1.8.142

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: 484a021badac24fd7cc60e51878246515d9f5a7c0061bc03a530161a9ca52be5
4
- data.tar.gz: 69fba225c87c16878d240c94956616cfab4ef3e1a8f3f3214435c2683fa796df
3
+ metadata.gz: 22b9f244f6e4a3c79fda643d0eca55e244a03ad5762412d2cb52f6175ee2ce97
4
+ data.tar.gz: b6bd24cdaad0054db3ad571623964a87517784933e0e01f7c67fe745fea5c93b
5
5
  SHA512:
6
- metadata.gz: 97b91683c848f49d69fb0df659923dbea16d45c0fcbe0f5ef30b8b48e70f7b59783ae6fd6097cba14e0942c98d789bad17f1dc752c231525ef8dda79b3620b3a
7
- data.tar.gz: 475504a104554c49b03c937148daf096ae043381bee59d5d9b2baae2e2847f32e432593c63d85849af497d27b3d4ca69937665e422a785b0e0849db608672e79
6
+ metadata.gz: 582ad0e2dd8f1f809a87ee5716b1770d05a00198d3d93a1b203151dca8cdf0c7844c18a499486686d6f95a84dd78c920263c07b6c73f4eff8ead2b6372cb412f
7
+ data.tar.gz: 01c8f26d18422745fdae325588c46d92828d65f86a677fece418ec2e98e9f6ba1fb9a694fb23d140ee270f1ca8a42d179b9667cc362e504be8aef43eefc9b28a
@@ -134,7 +134,6 @@ module Ishapi
134
134
  decoded = decode(params[:jwt_token])
135
135
  @current_user = User.find decoded['user_id']
136
136
  else
137
- puts! 'check_multiprofile(): no access token'
138
137
  raise "ww1 - not implemented"
139
138
  end
140
139
 
@@ -161,8 +160,6 @@ module Ishapi
161
160
 
162
161
  # this doesn't generate long-lived token, doesn't update user_profile
163
162
  def check_profile
164
- puts! params, 'params'
165
-
166
163
  # return check_multiprofile 'google'
167
164
  # return check_multiprofile 'facebook'
168
165
  return check_multiprofile 'jwt'
@@ -183,7 +180,6 @@ module Ishapi
183
180
 
184
181
  ## for sedux
185
182
  sign_in( @current_user )
186
- # puts! @current_user, '@current_user 222'
187
183
  end
188
184
 
189
185
  def set_profile
@@ -252,12 +248,13 @@ module Ishapi
252
248
  def check_jwt
253
249
  begin
254
250
  decoded = decode(params[:jwt_token])
255
- puts! decoded, 'decoded'
256
251
  @current_user = User.find decoded['user_id']
257
252
  rescue JWT::ExpiredSignature
258
253
  Rails.logger.info("JWT::ExpiredSignature")
259
- @current_user = User.new
254
+ rescue JWT::DecodeError
255
+ Rails.logger.info("JWT::DecodeError")
260
256
  end
257
+ @current_user ||= User.new
261
258
  current_ability
262
259
  end
263
260
 
@@ -24,7 +24,7 @@ module Ishapi
24
24
  @gallery = ::Gallery.unscoped.find_by :galleryname => params[:galleryname]
25
25
  authorize! :show, @gallery
26
26
  if @gallery.premium?
27
- if current_user.profile.has_premium_purchase( @gallery )
27
+ if current_user&.profile&.has_premium_purchase( @gallery )
28
28
  render 'show_premium_unlocked'
29
29
  else
30
30
  render 'show_premium_locked'
@@ -14,7 +14,7 @@ json.partial! 'ishapi/application/meta', :item => gallery
14
14
  if gallery.is_premium
15
15
  json.premium_tier gallery.premium_tier
16
16
  json.is_premium gallery.premium_tier > 0
17
- json.is_purchased current_user.profile.has_premium_purchase( gallery )
17
+ json.is_purchased current_user&.profile&.has_premium_purchase( gallery )
18
18
  json.partial! 'ishapi/photos/index', :photos => [ gallery.photos[0] ]
19
19
  else
20
20
  json.partial! 'ishapi/photos/index', :photos => gallery.photos
@@ -10,8 +10,8 @@ json.cache! this_key do
10
10
  json.is_premium @gallery.is_premium
11
11
  json.is_purchased false
12
12
 
13
- json.partial! 'ishapi/galleries/show', gallery: @gallery
14
- json.partial! 'ishapi/photos/index', :photos => [ @gallery.photos[0] ]
13
+ # json.partial! 'ishapi/galleries/show', gallery: @gallery
14
+ # json.partial! 'ishapi/photos/index', :photos => [ @gallery.photos[0] ]
15
15
  end
16
16
  end
17
17
 
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.138
4
+ version: 0.1.8.142
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-02 00:00:00.000000000 Z
11
+ date: 2021-08-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -284,7 +284,7 @@ homepage: http://wasya.co
284
284
  licenses:
285
285
  - MIT
286
286
  metadata: {}
287
- post_install_message:
287
+ post_install_message:
288
288
  rdoc_options: []
289
289
  require_paths:
290
290
  - lib
@@ -299,8 +299,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
299
299
  - !ruby/object:Gem::Version
300
300
  version: '0'
301
301
  requirements: []
302
- rubygems_version: 3.0.6
303
- signing_key:
302
+ rubygems_version: 3.2.25
303
+ signing_key:
304
304
  specification_version: 4
305
305
  summary: Summary of Ishapi.
306
306
  test_files: []