MCPcopy Index your code
hub / github.com/dnote/dnote / RespondUnauthorized

Function RespondUnauthorized

pkg/server/middleware/helpers.go:41–45  ·  view source on GitHub ↗

RespondUnauthorized responds with unauthorized

(w http.ResponseWriter)

Source from the content-addressed store, hash-verified

39
40// RespondUnauthorized responds with unauthorized
41func RespondUnauthorized(w http.ResponseWriter) {
42 UnsetSessionCookie(w)
43 w.Header().Add("WWW-Authenticate", `Bearer realm="Dnote", charset="UTF-8"`)
44 http.Error(w, "unauthorized", http.StatusUnauthorized)
45}
46
47// RespondNotFound responds with not found
48func RespondNotFound(w http.ResponseWriter) {

Callers 2

AuthFunction · 0.85
TokenAuthFunction · 0.85

Calls 2

UnsetSessionCookieFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected