portal/jwt/jwt.go

21 lines
325 B
Go
Raw Normal View History

2023-05-04 08:13:53 +00:00
package jwt
import (
"github.com/kataras/iris/v12/middleware/jwt"
_ "github.com/kataras/iris/v12/middleware/jwt"
)
var (
Secret = []byte("signature_hmac_secret_shared_key")
v *jwt.Verifier
)
func init() {
v = jwt.NewVerifier(jwt.HS256, Secret)
v.WithDefaultBlocklist()
}
func Get() *jwt.Verifier {
return v
}