func Token(
	claims *Claims,
	signature *Signature,
	options *Options,
) (string, error) {

	mapclaims := jwt.MapClaims{
		"email": claims.Email,
		"name":  claims.Name,
		"role":  claims.Role,
		"iat":   time.Now().Unix(),
		"exp":   options.Expiration,
	}
	if claims.Groups != nil {
		mapclaims["groups"] = claims.Groups
	}
	if claims.Rules != nil {
		mapclaims["rules"] = claims.Rules
	}
	token := jwt.NewWithClaims(signature.Type, mapclaims)
	signedtoken, err := token.SignedString(signature.Key)
	if err != nil {
		return "", err
	}

	return signedtoken, nil
}
// Token returns a signed JWT containing the claims provided
Token returns a signed JWT containing the claims provided
// Token returns a signed JWT containing the claims provided
func Token(
	claims *Claims,
	signature *Signature,
	options *Options,
) (string, error) {
	mapclaims := jwt.MapClaims{
		"email": claims.Email,
		"name":  claims.Name,
		"role":  claims.Role,
		"iat":   time.Now().Unix(),
		"exp":   options.Expiration,
	}
	if claims.Groups != nil {
		mapclaims["groups"] = claims.Groups
	}
	if claims.Rules != nil {
		mapclaims["rules"] = claims.Rules
	}
	token := jwt.NewWithClaims(signature.Type, mapclaims)
	signedtoken, err := token.SignedString(signature.Key)
	if err != nil {
		return "", err
	}
	return signedtoken, nil
}
func Token ( claims * Claims , signature * Signature , options * Options , ) ( string , error ) { mapclaims := jwt . MapClaims { " " : claims . Email , " " : claims . Name , " " : claims . Role , " " : time . Now ( ) . Unix ( ) , " " : options . Expiration , } if claims . Groups != nil { mapclaims [ " " ] = claims . Groups } if claims . Rules != nil { mapclaims [ " " ] = claims . Rules } token := jwt . NewWithClaims ( signature . Type , mapclaims ) signedtoken , err := token . SignedString ( signature . Key ) if err != nil { return " " , err } return signedtoken , nil }
Token returns a signed JWT containing the claims provided
Token returns a signed JWT containing the claims provided