Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Token Types TokenTypeAccess = "access_token" TokenTypeRefresh = "refresh_token" TokenTypeConfirm = "confirm_token" // AuthType AuthTypeBearer = "bearer" // Roles RoleUser = "user" RoleBusiness = "business" RoleAdmin = "admin" )
Variables ¶
This section is empty.
Functions ¶
func Init ¶
func Init(conf *config.Configuration) (err error)
Init initializes jwt, loads public and private key
Types ¶
type Claims ¶
type Claims struct { _jwt.StandardClaims // UserID is the User ID UserID string `json:"uid"` // EmailOK Email was confirmed i.e. user is valid EmailOK bool `json:"eok"` // Role user role "admin"|"user"|"business" Role string `json:"rol"` // TokenType is either an access_token, refresh_token, confirm_token TokenType string `json:"ttp"` // AuthType is the type of auth for the JWT (for now always "bearer") AuthType string `json:"ath"` }
Claims extends the StandarClaims
Click to show internal directories.
Click to hide internal directories.