mirror of
https://github.com/Threnklyn/jira.git
synced 2026-06-07 13:33:32 +02:00
add some debug messages to help diagnose login failures
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
|||||||
"code.google.com/p/gopass"
|
"code.google.com/p/gopass"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"net/http/httputil"
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
// "github.com/kr/pretty"
|
// "github.com/kr/pretty"
|
||||||
@@ -20,9 +21,12 @@ func (c *Cli) CmdLogin() error {
|
|||||||
passwd, _ := gopass.GetPass(prompt)
|
passwd, _ := gopass.GetPass(prompt)
|
||||||
|
|
||||||
req.SetBasicAuth(user, passwd)
|
req.SetBasicAuth(user, passwd)
|
||||||
|
log.Info("%s %s", req.Method, req.URL.String())
|
||||||
if resp, err := c.makeRequest(req); err != nil {
|
if resp, err := c.makeRequest(req); err != nil {
|
||||||
return err
|
return err
|
||||||
} else {
|
} else {
|
||||||
|
out, _ := httputil.DumpResponse(resp, true)
|
||||||
|
log.Debug("%s", out)
|
||||||
if resp.StatusCode == 403 {
|
if resp.StatusCode == 403 {
|
||||||
// probably got this, need to redirect the user to login manually
|
// probably got this, need to redirect the user to login manually
|
||||||
// X-Authentication-Denied-Reason: CAPTCHA_CHALLENGE; login-url=https://jira/login.jsp
|
// X-Authentication-Denied-Reason: CAPTCHA_CHALLENGE; login-url=https://jira/login.jsp
|
||||||
|
|||||||
Reference in New Issue
Block a user