Class: AppleAuth::UserIdentity

Inherits:
Object
  • Object
show all
Defined in:
lib/apple_auth/user_identity.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(user_identity, jwt) ⇒ UserIdentity

Returns a new instance of UserIdentity.



7
8
9
10
# File 'lib/apple_auth/user_identity.rb', line 7

def initialize(user_identity, jwt)
  @user_identity = user_identity
  @jwt = jwt
end

Instance Attribute Details

#jwtObject (readonly)

Returns the value of attribute jwt.



5
6
7
# File 'lib/apple_auth/user_identity.rb', line 5

def jwt
  @jwt
end

#user_identityObject (readonly)

Returns the value of attribute user_identity.



5
6
7
# File 'lib/apple_auth/user_identity.rb', line 5

def user_identity
  @user_identity
end

Instance Method Details

#validate!Object



12
13
14
15
16
17
18
# File 'lib/apple_auth/user_identity.rb', line 12

def validate!
  token_data = JWTDecoder.new(jwt).call

  JWTConditions.new(user_identity, token_data).validate!

  token_data.symbolize_keys
end