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