X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/d97c9ecca25f449ad928963f6257a01a8bbbf1e7..8e60faf420f02d750bbaf7792343a95d2c2674ae:/sdk/go/arvados/login.go diff --git a/sdk/go/arvados/login.go b/sdk/go/arvados/login.go index 7107ac57ab..ab76375462 100644 --- a/sdk/go/arvados/login.go +++ b/sdk/go/arvados/login.go @@ -10,8 +10,8 @@ import ( ) type LoginResponse struct { - RedirectLocation string - HTML bytes.Buffer + RedirectLocation string `json:"redirect_location,omitempty"` + HTML bytes.Buffer `json:"-"` } func (resp LoginResponse) ServeHTTP(w http.ResponseWriter, req *http.Request) { @@ -24,3 +24,12 @@ func (resp LoginResponse) ServeHTTP(w http.ResponseWriter, req *http.Request) { w.Write(resp.HTML.Bytes()) } } + +type LogoutResponse struct { + RedirectLocation string `json:"redirect_location,omitempty"` +} + +func (resp LogoutResponse) ServeHTTP(w http.ResponseWriter, req *http.Request) { + w.Header().Set("Location", resp.RedirectLocation) + w.WriteHeader(http.StatusFound) +}