ishapi 0.1.8.137 → 0.1.8.141
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: 4cb2445a1bf7bb72379c50c715e525a4a25e9fb935f82a6f1aa4a0973d983a8e
|
4
|
+
data.tar.gz: 690d1d6c4af836ddf56739969b9231e86f785e220944d5aedcd2e2ae779d9441
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4fbc093ce463bd15b63d07efe534815551c2d9e85244ec412907af8208639916b8c87b5ffa4a1c8456a1668c0208e81abe360c15fb2e0b902efcc3dd801ac797
|
7
|
+
data.tar.gz: '0568bb4b138b37874bdad4a86ad93f6e465ee333d841ed5ef41958cd98cfcf0bc1ce5fea4df400ead891cca085a91fab872038ee1eddf60ab6eda76683823ac9'
|
@@ -5,9 +5,6 @@ module Ishapi
|
|
5
5
|
protect_from_forgery :prepend => true, :with => :exception
|
6
6
|
layout :false
|
7
7
|
|
8
|
-
# before_action :check_profile, except: [ :test ]
|
9
|
-
# before_action :set_current_ability
|
10
|
-
|
11
8
|
check_authorization except: [ :long_term_token ]
|
12
9
|
skip_before_action :verify_authenticity_token
|
13
10
|
|
@@ -143,7 +140,7 @@ module Ishapi
|
|
143
140
|
|
144
141
|
# @TODO: refactor [ref-5]
|
145
142
|
sign_in @current_user, scope: :user
|
146
|
-
|
143
|
+
current_ability
|
147
144
|
end
|
148
145
|
|
149
146
|
|
@@ -253,10 +250,17 @@ module Ishapi
|
|
253
250
|
|
254
251
|
# jwt
|
255
252
|
def check_jwt
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
253
|
+
begin
|
254
|
+
decoded = decode(params[:jwt_token])
|
255
|
+
puts! decoded, 'decoded'
|
256
|
+
@current_user = User.find decoded['user_id']
|
257
|
+
rescue JWT::ExpiredSignature
|
258
|
+
Rails.logger.info("JWT::ExpiredSignature")
|
259
|
+
rescue JWT::DecodeError
|
260
|
+
Rails.logger.info("JWT::DecodeError")
|
261
|
+
end
|
262
|
+
@current_user ||= User.new
|
263
|
+
current_ability
|
260
264
|
end
|
261
265
|
|
262
266
|
# jwt
|
@@ -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
|
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
|
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.
|
4
|
+
version: 0.1.8.141
|
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-
|
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.
|
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: []
|