mirror of
https://github.com/Threnklyn/jira.git
synced 2026-06-07 05:23:33 +02:00
handle html response on expired cookies (require X-Ausername header to always be present)
This commit is contained in:
+2
-1
@@ -94,7 +94,8 @@ func main() {
|
|||||||
o := oreo.New().WithCookieFile(filepath.Join(jiracli.Homedir(), fig.ConfigDir, "cookies.js"))
|
o := oreo.New().WithCookieFile(filepath.Join(jiracli.Homedir(), fig.ConfigDir, "cookies.js"))
|
||||||
o = o.WithPostCallback(
|
o = o.WithPostCallback(
|
||||||
func(req *http.Request, resp *http.Response) (*http.Response, error) {
|
func(req *http.Request, resp *http.Response) (*http.Response, error) {
|
||||||
if resp.Header.Get("X-Ausername") == "anonymous" {
|
authUser := resp.Header.Get("X-Ausername")
|
||||||
|
if authUser == "" || authUser == "anonymous" {
|
||||||
// we are not logged in, so force login now by running the "login" command
|
// we are not logged in, so force login now by running the "login" command
|
||||||
app.Parse([]string{"login"})
|
app.Parse([]string{"login"})
|
||||||
return o.Do(req)
|
return o.Do(req)
|
||||||
|
|||||||
Reference in New Issue
Block a user