package auth

import "context"

type contextKey string

const sessionStateKey contextKey = "auth.session-state"

func NewContext(ctx context.Context, state *SessionState) context.Context {
	return context.WithValue(ctx, sessionStateKey, state)
}

func FromContext(ctx context.Context) (*SessionState, bool) {
	state, ok := ctx.Value(sessionStateKey).(*SessionState)
	return state, ok
}
