writeJSON encodes payload as the response body and logs encode errors rather than swallowing them — useful for debugging truncated responses when a client drops mid-write.
(w http.ResponseWriter, payload any)
| 28 | // rather than swallowing them — useful for debugging truncated responses |
| 29 | // when a client drops mid-write. |
| 30 | func writeJSON(w http.ResponseWriter, payload any) { |
| 31 | if err := json.NewEncoder(w).Encode(payload); err != nil { |
| 32 | log.Printf("[auth] json encode failed: %v", err) |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | const ( |
| 37 | SessionCookieName = "e2a_session" |
no outgoing calls
no test coverage detected