minato-rails-auth 0.2.1 → 0.2.2

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: f852d8c8fb4a6ab7e5afa05144de2fcc622ac073e7830fa4f4229d9975941d78
4
- data.tar.gz: d8ad8fd69b33b1e952c363d9c149dba390f313b1168f0226678e78708efca5b3
3
+ metadata.gz: 066ebdf4bb5c9974b2fb7081cb9a49b1f94cc7827bade857513537a189567eb6
4
+ data.tar.gz: 9360a913dda2ef27b36e5ef6f5608b9f3663f5a9f0fbd14efcae7ef09575298f
5
5
  SHA512:
6
- metadata.gz: 19744e2044ad31a4754435d0df1ab7cdff2233ce5ce8f36ad971ec0dc08544ca3506297ec04e55f5f50f0e5943e19f2bbd12b93633e42e586c34e336e6ff4959
7
- data.tar.gz: bcbfdec2e4b3b57c914e326e44d7e24490959d356bf838aca0a3a0a764880ba89b7982abe0edce4024502c75118a7bb53d82089628091d5ba7c73d3284e552bb
6
+ metadata.gz: 3d218d8a28492a771b5217c053975bcedc2c2435200c31ff28012d7ce6be28a2eff526221f7c5095bea55b1056ca8b764a5dc09a7fd13aadb9ae4580f8976e53
7
+ data.tar.gz: 946d093736ee168f09a9bded1b94c5e78bd941ec5dad35d3b8e0af1150ef30d2161f2443fbc6f1f3dc1945a063d13ead5adc23a91d90ef89ba3efce8a285d257
@@ -13,14 +13,16 @@ module Minato
13
13
  end
14
14
 
15
15
  def human?
16
- @human ||= @token_payload.respond_to?(:session)
16
+ session&.identity.present?
17
17
  end
18
18
 
19
19
  def machine?
20
- @machine ||= !human?
20
+ !human?
21
21
  end
22
22
 
23
23
  def identity
24
+ return nil if machine?
25
+
24
26
  return impersonator_identity unless impersonated?
25
27
 
26
28
  session.identity.metadata_public.impersonated_identity
@@ -35,6 +37,8 @@ module Minato
35
37
  end
36
38
 
37
39
  def impersonated?
40
+ return false if machine?
41
+
38
42
  session.identity.metadata_public&.impersonated_identity.present?
39
43
  end
40
44
 
@@ -3,7 +3,7 @@
3
3
  module Minato
4
4
  module Rails
5
5
  module Auth
6
- VERSION = '0.2.1'
6
+ VERSION = '0.2.2'
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minato-rails-auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ferreri
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-10-30 00:00:00.000000000 Z
11
+ date: 2024-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport