MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / disabledAccountPathAllowed

Function disabledAccountPathAllowed

internal/server/middleware_auth.go:495–503  ·  view source on GitHub ↗

disabledAccountPathAllowed is what a disabled account may still do: sign out, and ask for its session state (which reports account_disabled).

(r *http.Request)

Source from the content-addressed store, hash-verified

493// disabledAccountPathAllowed is what a disabled account may still do: sign
494// out, and ask for its session state (which reports account_disabled).
495func disabledAccountPathAllowed(r *http.Request) bool {
496 switch r.URL.Path {
497 case "/api/v1/auth/logout":
498 return r.Method == http.MethodPost
499 case "/api/v1/auth/session":
500 return r.Method == http.MethodGet
501 }
502 return false
503}
504
505// RequireAuth middleware blocks unauthenticated requests when users exist
506// in the system. When no users exist (fresh install), all requests pass

Callers 1

RequireAuthMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected