[#160] prompt when api-token is invalid to get new token

This commit is contained in:
Cory Bennett
2018-04-15 15:30:30 -07:00
parent 06b26c9e00
commit e639cce9af
+3
View File
@@ -123,6 +123,9 @@ func register(app *kingpin.Application, o *oreo.Client, fig *figtree.FigTree) {
// rerun the original request
return o.Do(req)
}
} else if globals.AuthMethod() == "api-token" && resp.StatusCode == 401 {
globals.SetPass("")
return o.Do(req)
}
return resp, nil
},