diff --git a/internal/ghl/oauth.go b/internal/ghl/oauth.go index 640c473..99e21e3 100644 --- a/internal/ghl/oauth.go +++ b/internal/ghl/oauth.go @@ -5,6 +5,7 @@ import ( "encoding/json" "errors" "fmt" + "html/template" "io" "log/slog" "net/http" @@ -108,7 +109,8 @@ func (h *OAuthHandler) HandleCallback(w http.ResponseWriter, r *http.Request) { slog.Info("ghl oauth bulk install complete", "company_id", tokenResp.CompanyID, "locations_installed", installed) w.Header().Set("Content-Type", "text/html; charset=utf-8") w.WriteHeader(http.StatusOK) - _, _ = fmt.Fprintf(w, `

Cast SMS installed successfully!

Connected %d location(s). You can close this tab.

`, installed) + tmpl := template.Must(template.New("ok").Parse(`

Cast SMS installed successfully!

Connected {{.}} location(s). You can close this tab.

`)) + _ = tmpl.Execute(w, installed) return }