// Logout and Login handlers would normally be centralized and provided by a separate package owned by the security team.
// Since this is a simple example application they are here together with the rest.
Logout and Login handlers would normally be centralized and provided by a separate package owned by the security team.
Since this is a simple example application they are here together with the rest.
// Logout and Login handlers would normally be centralized and provided by a separate package owned by the security team . // Since this is a simple example application they are here together with the rest .
func logoutHandler(deps *serverDeps) safehttp.Handler {
	return safehttp.HandlerFunc(func(rw safehttp.ResponseWriter, r *safehttp.IncomingRequest) safehttp.Result {
		secure.ClearSession(r)
		return safehttp.Redirect(rw, r, "/", safehttp.StatusSeeOther)
	})
}
func logoutHandler ( deps * serverDeps ) safehttp . Handler { return safehttp . HandlerFunc ( func ( rw safehttp . ResponseWriter , r * safehttp . IncomingRequest ) safehttp . Result { secure . ClearSession ( r ) return safehttp . Redirect ( rw , r , " " , safehttp . StatusSeeOther ) } ) }
Logout and Login handlers would normally be centralized and provided by a separate package owned by the security team.
Logout and Login handlers would normally be centralized and provided by a separate package owned by the security team .