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

Function withAuthedUser

internal/web/context.go:43–45  ·  view source on GitHub ↗

withAuthedUser stores the authenticated UserRecord in the request context.

(ctx context.Context, u *users.UserRecord)

Source from the content-addressed store, hash-verified

41
42// withAuthedUser stores the authenticated UserRecord in the request context.
43func withAuthedUser(ctx context.Context, u *users.UserRecord) context.Context {
44 return context.WithValue(ctx, authedUserKey, u)
45}
46
47// GetAuthedUser retrieves the authenticated UserRecord from the request context.
48// Returns nil when no user is stored (e.g. internal requests).

Calls

no outgoing calls