gopay/internal/jwt/jwt.go

18 lines
245 B
Go
Raw Normal View History

2024-06-03 12:51:42 +00:00
package jwt
import "github.com/golang-jwt/jwt"
// JWT secret
2024-06-03 13:51:42 +00:00
var secret []byte
2024-06-03 12:51:42 +00:00
// JWT claims
type Claims struct {
jwt.StandardClaims
2024-06-06 18:17:55 +00:00
ID int64 `json:"id"` // Account ID
2024-06-03 12:51:42 +00:00
}
// Set the JWT secret
func New(sec string) {
2024-06-03 13:51:42 +00:00
secret = []byte(sec)
2024-06-03 12:51:42 +00:00
}