SignupEnabled handles GET /auth/signup-enabled.
(w http.ResponseWriter, r *http.Request)
| 1282 | |
| 1283 | // SignupEnabled handles GET /auth/signup-enabled. |
| 1284 | func (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). |
| 1297 | func (h *AuthHandler) SetupAdmin(w http.ResponseWriter, r *http.Request) { |