//
pkg.gl
Category
github.com/DariSorokina/go-first-sprint
internal
cookie
package
0.0.0-20241003173054-2604c7f51879
Repository:
https://github.com/darisorokina/go-first-sprint.git
Documentation:
pkg.go.dev
Overview
Versions
1
Dependencies
8
Dependents
1
Files
139 SLOC
#
Functions
CookieMiddleware
CookieMiddleware returns a middleware that ensures each request has a valid JWT in the "ClientID" cookie.
СreateCookieClientID
СreateCookieClientID creates a JWT token and embeds it in an HTTP cookie.
#
Constants
SECRETKEY
Constant TOKENEXP is used for specifying the secret key used for signing JWT.
TOKENEXP
Constant TOKENEXP is used for specifying the token expiration time.
#
Structs
Claims
Claims struct includes the registered claims from jwt package and a custom UserID field.