// Copyright 2019 Drone.IO Inc. All rights reserved. // Use of this source code is governed by the Drone Non-Commercial License // that can be found in the LICENSE file. package web import ( "net/http" "github.com/drone/drone-ui/dist" ) // HandleLogout creates an http.HandlerFunc that handles // session termination. func HandleLogout() http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { w.Header().Add("Set-Cookie", "_session_=deleted; Path=/; Max-Age=0") w.Header().Set("Content-Type", "text/html; charset=UTF-8") w.Write( dist.MustLookup("/index.html"), ) } }