ibrain-core 0.5.10 → 0.5.12
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 +4 -4
- data/app/graphql/ibrain/extentions/active_required.rb +2 -2
- data/lib/ibrain/core/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6bac2bf8a32b4d4271635b858daf8b608adde64dfee63b468afe5ee62b093537
|
4
|
+
data.tar.gz: 6143364930072c20ba64208b15482fb36b88a809c10f1e0ed01266039138d9aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc34b2df8d63e286d05c589f797baee4d824982147f783564acc367b2433ebfc48422929e83888851c88fa27d55a2022b4abf43546e1d48cec664c3862256342
|
7
|
+
data.tar.gz: 5e15776e2b885d468f0ee2eff619956da2e16d5f327ecaec1c3b586e663bfb824278fcdde48432b3300d94c00ac1e5dad4c198d6bdbb174fe23368e7b3a33d47
|
@@ -4,7 +4,7 @@ module Ibrain
|
|
4
4
|
module Extentions
|
5
5
|
class ActiveRequired < GraphQL::Schema::FieldExtension
|
6
6
|
def resolve(object:, arguments:, **rest)
|
7
|
-
raise ActionController::InvalidAuthenticityToken, I18n.t('ibrain.errors.session.is_deactivated')
|
7
|
+
raise ActionController::InvalidAuthenticityToken, I18n.t('ibrain.errors.session.is_deactivated') unless is_activated(object)
|
8
8
|
|
9
9
|
# yield the current time as `memo`
|
10
10
|
yield(object, arguments, rest)
|
@@ -12,7 +12,7 @@ module Ibrain
|
|
12
12
|
|
13
13
|
private
|
14
14
|
|
15
|
-
def
|
15
|
+
def is_activated(object)
|
16
16
|
current_user = object.try(:context).try(:fetch, :current_user, nil)
|
17
17
|
current_user.try(:is_activated?)
|
18
18
|
end
|
data/lib/ibrain/core/version.rb
CHANGED