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

Function currentUser

internal/server/middleware_auth.go:514–517  ·  view source on GitHub ↗

currentUser returns the authenticated user from the request context, or nil if no user is authenticated.

(r *http.Request)

Source from the content-addressed store, hash-verified

512// currentUser returns the authenticated user from the request context,
513// or nil if no user is authenticated.
514func currentUser(r *http.Request) *models.User {
515 u, _ := r.Context().Value(ctxCurrentUser).(*models.User)
516 return u
517}
518
519// isAPITokenAuth returns true if the request was authenticated via an API token
520// (not a session cookie or CLI session). Use this to gate sensitive operations

Callers 15

rateLimitKeyFunction · 0.85
handleCollabMethod · 0.85
actorIDFromRequestFunction · 0.85
authorizeCollabAccessMethod · 0.85
actorNameFromRequestFunction · 0.85
resolverItemVisibleMethod · 0.85
getWorkspaceIDMethod · 0.85
getWorkspaceMethod · 0.85
visibleCollectionIDsMethod · 0.85
requireItemVisibleMethod · 0.85

Calls

no outgoing calls