MCPcopy
hub / github.com/PatchMon/PatchMon / SignupEnabled

Method SignupEnabled

server-source-code/internal/handler/auth.go:1284–1294  ·  view source on GitHub ↗

SignupEnabled handles GET /auth/signup-enabled.

(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

1282
1283// SignupEnabled handles GET /auth/signup-enabled.
1284func (h *AuthHandler) SignupEnabled(w http.ResponseWriter, r *http.Request) {
1285 if h.log != nil {
1286 h.log.Debug("auth request", "method", r.Method, "path", r.URL.Path)
1287 }
1288 s, err := h.settings.GetFirst(r.Context())
1289 if err != nil {
1290 JSON(w, http.StatusOK, map[string]bool{"signupEnabled": false})
1291 return
1292 }
1293 JSON(w, http.StatusOK, map[string]bool{"signupEnabled": s.SignupEnabled})
1294}
1295
1296// SetupAdmin handles POST /auth/setup-admin (first-time admin creation).
1297func (h *AuthHandler) SetupAdmin(w http.ResponseWriter, r *http.Request) {

Callers

nothing calls this directly

Calls 2

GetFirstMethod · 0.80
JSONFunction · 0.70

Tested by

no test coverage detected