Files
ezbookkeeping/pkg/core/token_claims.go
T
2022-03-20 23:20:11 +08:00

23 lines
451 B
Go

package core
import (
"github.com/golang-jwt/jwt/v4"
)
// TokenType represents token type
type TokenType byte
// Token types
const (
USER_TOKEN_TYPE_NORMAL TokenType = 1
USER_TOKEN_TYPE_REQUIRE_2FA TokenType = 2
)
// UserTokenClaims represents user token
type UserTokenClaims struct {
UserTokenId string `json:"userTokenId"`
Username string `json:"username,omitempty"`
Type TokenType `json:"type"`
jwt.StandardClaims
}