MCPcopy Index your code
hub / github.com/dnote/dnote / WithToken

Function WithToken

pkg/server/context/user.go:37–39  ·  view source on GitHub ↗

WithToken creates a new context with the given user

(ctx context.Context, tok *database.Token)

Source from the content-addressed store, hash-verified

35
36// WithToken creates a new context with the given user
37func WithToken(ctx context.Context, tok *database.Token) context.Context {
38 return context.WithValue(ctx, tokenKey, tok)
39}
40
41// User retrieves a user from the given context. It returns a pointer to
42// a user. If the context does not contain a user, it returns nil.

Callers 1

TokenAuthFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected