mirror of
https://github.com/jlengrand/github-api.git
synced 2026-04-01 15:50:48 +00:00
Comments for the path of OTP exception
This commit is contained in:
@@ -758,7 +758,9 @@ class Requester {
|
||||
IOUtils.closeQuietly(es);
|
||||
}
|
||||
}
|
||||
if (responseCode == HttpURLConnection.HTTP_UNAUTHORIZED) // 401 Unauthorized == bad creds
|
||||
if (responseCode == HttpURLConnection.HTTP_UNAUTHORIZED) // 401 Unauthorized == bad creds or OTP request
|
||||
// In the case of a user with 2fa enabled, a header with X-GitHub-OTP
|
||||
// will be returned indicating the user needs to respond with an otp
|
||||
if(uc.getHeaderField("X-GitHub-OTP") != null)
|
||||
throw (IOException) new GHOTPRequiredException().withResponseHeaderFields(uc).initCause(e);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user