func()

in oauth/oauth.go [61:79]


func (a *Handler) Handler(w http.ResponseWriter, r *http.Request) error {
	ctx := r.Context()
	if !rellenv.IsEmployee(ctx) {
		return ctxerr.Wrap(ctx, errEmployeesOnly)
	}

	switch r.URL.Path {
	case Path:
		return a.Start(ctx, w, r)
	case Path + resp:
		return a.Response(ctx, w, r)
	}
	w.Header().Set("Content-Type", "text/html; charset=utf-8")
	w.WriteHeader(http.StatusNotFound)
	_, err := h.Write(ctx, w, &h.Script{
		Inner: h.Unsafe("top.location='/'"),
	})
	return err
}