MCPcopy
hub / github.com/usememos/memos / CreateUserContext

Method CreateUserContext

server/router/api/v1/test/test_helper.go:88–91  ·  view source on GitHub ↗

CreateUserContext creates a context with the given user's ID for authentication.

(ctx context.Context, userID int32)

Source from the content-addressed store, hash-verified

86
87// CreateUserContext creates a context with the given user's ID for authentication.
88func (*TestService) CreateUserContext(ctx context.Context, userID int32) context.Context {
89 // Use the context key from the auth package
90 return context.WithValue(ctx, auth.UserIDContextKey, userID)
91}

Calls

no outgoing calls