X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/e9bfb6900e3340bfcdcea691466cd849ca7d9ffc..3f3686330be2141f0cacc511eabac15cc8449e7c:/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) +}