18 lines
242 B
Go
18 lines
242 B
Go
package jwt
|
|
|
|
import "github.com/golang-jwt/jwt"
|
|
|
|
// JWT secret
|
|
var secret []byte
|
|
|
|
// JWT claims
|
|
type Claims struct {
|
|
jwt.StandardClaims
|
|
ID int64 `json:"id"` // User ID
|
|
}
|
|
|
|
// Set the JWT secret
|
|
func New(sec string) {
|
|
secret = []byte(sec)
|
|
}
|