JSON Web Token (JWT) more information: http://self-issued.info/docs/draft-ietf-oauth-json-web-token.html
$ go get github.com/jayhuang75/gin-jwt-middleware
import (
"github.com/jayhuang75/gin-jwt-middleware"
)
app := gin.Default()
app.Use(auth.JWTAuthMiddleware(encoded, YOUR_SECRET)
- encoded is a boolen: if your JWT secret is encoded
- YOUR_SECRET: Your JWT secret, here you can use the env variable