Class: Stormpath::Rails::ControllerAuthentication::FromCookies
- Inherits:
-
Object
- Object
- Stormpath::Rails::ControllerAuthentication::FromCookies
- Defined in:
- app/services/stormpath/rails/controller_authentication/from_cookies.rb
Constant Summary collapse
- OAUTH_ERROR_CODE_RANGE =
(10_000...10_100)
Instance Attribute Summary collapse
-
#cookies ⇒ Object
readonly
Returns the value of attribute cookies.
Instance Method Summary collapse
- #authenticate! ⇒ Object
-
#initialize(cookies) ⇒ FromCookies
constructor
A new instance of FromCookies.
Constructor Details
#initialize(cookies) ⇒ FromCookies
Returns a new instance of FromCookies.
9 10 11 |
# File 'app/services/stormpath/rails/controller_authentication/from_cookies.rb', line 9 def initialize() @cookies = end |
Instance Attribute Details
#cookies ⇒ Object (readonly)
Returns the value of attribute cookies.
7 8 9 |
# File 'app/services/stormpath/rails/controller_authentication/from_cookies.rb', line 7 def @cookies end |
Instance Method Details
#authenticate! ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'app/services/stormpath/rails/controller_authentication/from_cookies.rb', line 13 def authenticate! begin AccountFromAccessToken.new().account rescue AccountFromAccessToken::NoAccessToken, Stormpath::Oauth::Error, JWT::DecodeError fetch_account_from_refresh_token rescue Stormpath::Error => error raise unless OAUTH_ERROR_CODE_RANGE.include?(error.code) fetch_account_from_refresh_token rescue AccountFromAccessToken::AuthenticationWithRefreshTokenAttemptError, AccountFromAccessToken::DifferentIssuerError raise UnauthenticatedRequest end end |