MCPcopy Create free account
hub / github.com/GoMudEngine/GoMud / GetAuthedUser

Function GetAuthedUser

internal/web/context.go:49–52  ·  view source on GitHub ↗

GetAuthedUser retrieves the authenticated UserRecord from the request context. Returns nil when no user is stored (e.g. internal requests).

(r *http.Request)

Source from the content-addressed store, hash-verified

47// GetAuthedUser retrieves the authenticated UserRecord from the request context.
48// Returns nil when no user is stored (e.g. internal requests).
49func GetAuthedUser(r *http.Request) *users.UserRecord {
50 u, _ := r.Context().Value(authedUserKey).(*users.UserRecord)
51 return u
52}

Callers 9

pageReadOnlyFunction · 0.85
serveAdminTemplateFunction · 0.85
RegisterAdminPageMethod · 0.85
httpsIndexFunction · 0.85
adminIndexFunction · 0.85
RequirePermissionFunction · 0.85
RequireAnyPermissionFunction · 0.85
RequireAdminFunction · 0.85
authedUserIsAdminFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected