Versions in this module Expand all Collapse all v0 v0.17.0 Mar 17, 2026 Changes in this version + const OAuth2StateCookieName + const OAuth2StateExpiration + const StateByteLength + var ErrCookieNotFound = errors.New("cookie not found") + var ErrInvalidStateInfo = errors.New("invalid state info") + func ClearAuthCookie(w http.ResponseWriter) + func ClearCookie(w http.ResponseWriter, name string) + func ClearOAuth2StateCookie(w http.ResponseWriter) + func FromRequestContext[T any](r *http.Request, key any) (T, bool) + func GetCookie(r *http.Request, name string) (string, error) + func GetJWTFromCookie(r *http.Request) (string, error) + func InputFromContext[T any](r *http.Request) (T, bool) + func SetAuthCookie(w http.ResponseWriter, tokenString string, maxAge int) + func SetCookie(w http.ResponseWriter, name, value string, maxAge int) + func SetOAuth2StateCookie(w http.ResponseWriter, state string) + func VerifyOAuth2State(r *http.Request, state string) error + type State struct + func NewState() (*State, error) + func NewStateFromEncode(stateStr string) (*State, error) + func (s *State) AddInfo(key, value string) + func (s *State) GetInfo(key string) (string, bool) + func (s *State) String() string