Class: Stormpath::Rails::AccountFromAccessToken

Inherits:
Object
  • Object
show all
Defined in:
app/services/stormpath/rails/account_from_access_token.rb

Constant Summary collapse

NoAccessToken =
Class.new(ArgumentError)
AuthenticationWithRefreshTokenAttemptError =
Class.new(ArgumentError)
DifferentIssuerError =
Class.new(ArgumentError)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(access_token) ⇒ AccountFromAccessToken

Returns a new instance of AccountFromAccessToken.

Raises:



10
11
12
13
# File 'app/services/stormpath/rails/account_from_access_token.rb', line 10

def initialize(access_token)
  raise(NoAccessToken) if access_token.blank?
  @access_token = access_token
end

Instance Attribute Details

#access_tokenObject (readonly)

Returns the value of attribute access_token.



4
5
6
# File 'app/services/stormpath/rails/account_from_access_token.rb', line 4

def access_token
  @access_token
end

Instance Method Details

#accountObject



15
16
17
# File 'app/services/stormpath/rails/account_from_access_token.rb', line 15

def 
  @account ||= resolution_instance.verify(access_token).
end