1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: Apache-2.0
12 type LoginResponse struct {
13 RedirectLocation string `json:"redirect_location,omitempty"`
14 HTML bytes.Buffer `json:"-"`
17 func (resp LoginResponse) ServeHTTP(w http.ResponseWriter, req *http.Request) {
18 w.Header().Set("Cache-Control", "no-store")
19 if resp.RedirectLocation != "" {
20 w.Header().Set("Location", resp.RedirectLocation)
21 w.WriteHeader(http.StatusFound)
23 w.Header().Set("Content-Type", "text/html")
24 w.Write(resp.HTML.Bytes())
28 type LogoutResponse struct {
29 RedirectLocation string `json:"redirect_location,omitempty"`
32 func (resp LogoutResponse) ServeHTTP(w http.ResponseWriter, req *http.Request) {
33 w.Header().Set("Location", resp.RedirectLocation)
34 w.WriteHeader(http.StatusFound)