Exception: PactasItero::OneTimePasswordRequired
- Inherits:
-
ClientError
- Object
- StandardError
- Error
- ClientError
- PactasItero::OneTimePasswordRequired
- Defined in:
- lib/pactas_itero/error.rb
Overview
Raised when Pactas returns a 401 HTTP status code and headers include “X-Pactas-OTP”
Constant Summary collapse
- OTP_DELIVERY_PATTERN =
/required; (\w+)/i
Class Method Summary collapse
Instance Method Summary collapse
-
#password_delivery ⇒ String
Delivery method for the user’s OTP.
Methods inherited from Error
error_for401, error_for403, #errors, from_response, #initialize
Constructor Details
This class inherits a constructor from PactasItero::Error
Class Method Details
.required_header(headers) ⇒ Object
151 152 153 |
# File 'lib/pactas_itero/error.rb', line 151 def self.required_header(headers) OTP_DELIVERY_PATTERN.match headers["X-Pactas-OTP"].to_s end |
Instance Method Details
#password_delivery ⇒ String
Delivery method for the user’s OTP
158 159 160 |
# File 'lib/pactas_itero/error.rb', line 158 def password_delivery @_password_delivery ||= delivery_method_from_header end |