MCPcopy
hub / github.com/dghubble/gologin / WithState

Function WithState

oauth2/context.go:19–21  ·  view source on GitHub ↗

WithState returns a copy of ctx that stores the state value.

(ctx context.Context, state string)

Source from the content-addressed store, hash-verified

17
18// WithState returns a copy of ctx that stores the state value.
19func WithState(ctx context.Context, state string) context.Context {
20 return context.WithValue(ctx, stateKey, state)
21}
22
23// StateFromContext returns the state value from the ctx.
24func StateFromContext(ctx context.Context) (string, error) {

Callers 6

TestContext_StateFunction · 0.85
TestLoginHandlerFunction · 0.85
TestCallbackHandlerFunction · 0.85
StateHandlerFunction · 0.85

Calls

no outgoing calls

Tested by 5

TestContext_StateFunction · 0.68
TestLoginHandlerFunction · 0.68
TestCallbackHandlerFunction · 0.68