MCPcopy Create free account
hub / github.com/netlify/gotrue / sendJSON

Function sendJSON

api/helpers.go:40–49  ·  view source on GitHub ↗
(w http.ResponseWriter, status int, obj interface{})

Source from the content-addressed store, hash-verified

38}
39
40func sendJSON(w http.ResponseWriter, status int, obj interface{}) error {
41 w.Header().Set("Content-Type", "application/json")
42 b, err := json.Marshal(obj)
43 if err != nil {
44 return errors.Wrap(err, fmt.Sprintf("Error encoding json response: %v", obj))
45 }
46 w.WriteHeader(status)
47 _, err = w.Write(b)
48 return err
49}
50
51func getUserFromClaims(ctx context.Context, conn *storage.Connection) (*models.User, error) {
52 claims := getClaims(ctx)

Callers 15

HealthCheckMethod · 0.85
RecoverMethod · 0.85
InviteMethod · 0.85
SignupMethod · 0.85
adminUsersMethod · 0.85
adminUserGetMethod · 0.85
adminUserUpdateMethod · 0.85
adminUserCreateMethod · 0.85
adminUserDeleteMethod · 0.85
VerifyMethod · 0.85
SettingsMethod · 0.85
adminAuditLogMethod · 0.85

Calls 2

WriteHeaderMethod · 0.80
WriteMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…