class Octokit::OneTimePasswordRequired
Raised when GitHub returns a 401 HTTP status code and headers include “X-GitHub-OTP”
Constants
- OTP_DELIVERY_PATTERN
-
@private
Public Class Methods
Source
# File lib/octokit/error.rb, line 246 def self.required_header(headers) OTP_DELIVERY_PATTERN.match headers['X-GitHub-OTP'].to_s end
@private
Public Instance Methods
Source
# File lib/octokit/error.rb, line 253 def password_delivery @password_delivery ||= delivery_method_from_header end
Delivery method for the user’s OTP
@return [String]
Private Instance Methods
Source
# File lib/octokit/error.rb, line 259 def delivery_method_from_header if match = self.class.required_header(@response[:response_headers]) match[1] end end