- Add test/integration.test.ts: getServicePublicKey, full flow (register, login, createCollection, createPointFeature, listFeatures) - Update docs example: registerBySigningServiceKey then loginWithSignature - Document integration tests in typescript-frontend-integration.md Made-with: Cursor
This commit is contained in:
@@ -103,7 +103,12 @@ func statusFromErr(err error) int {
|
||||
}
|
||||
|
||||
func writeErr(w http.ResponseWriter, err error) {
|
||||
writeJSON(w, statusFromErr(err), map[string]string{"error": err.Error()})
|
||||
payload := map[string]string{"error": err.Error()}
|
||||
if errors.Is(err, app.ErrRegistrationNotConfigured) {
|
||||
payload["code"] = "REGISTRATION_NOT_CONFIGURED"
|
||||
payload["hint"] = "Run ./bin/gen-server-keys.sh to create etc/server-service.env, or set ADMIN_PUBLIC_KEY before starting the API."
|
||||
}
|
||||
writeJSON(w, statusFromErr(err), payload)
|
||||
}
|
||||
|
||||
func bearerToken(r *http.Request) (string, error) {
|
||||
|
||||
Reference in New Issue
Block a user