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

Method requireAuthentication

api/auth.go:12–20  ·  view source on GitHub ↗

requireAuthentication checks incoming requests for tokens presented using the Authorization header

(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

10
11// requireAuthentication checks incoming requests for tokens presented using the Authorization header
12func (a *API) requireAuthentication(w http.ResponseWriter, r *http.Request) (context.Context, error) {
13 token, err := a.extractBearerToken(w, r)
14 if err != nil {
15 a.clearCookieToken(r.Context(), w)
16 return nil, err
17 }
18
19 return a.parseJWTClaims(token, r, w)
20}
21
22type adminCheckParams struct {
23 Aud string `json:"aud"`

Callers

nothing calls this directly

Calls 3

extractBearerTokenMethod · 0.95
clearCookieTokenMethod · 0.95
parseJWTClaimsMethod · 0.95

Tested by

no test coverage detected