This commit is contained in:
Peter Kieltyka 2023-12-05 13:36:22 -05:00
parent ecb7305746
commit 4e5a7fd5c2
2 changed files with 12 additions and 1 deletions

View file

@ -103,6 +103,17 @@ func router() http.Handler {
} }
``` ```
# Util
See https://github.com/goware/jwtutil for utility to help you generate JWT tokens.
`go install github.com/goware/jwtutil`
Usage: `jwtutil -secret=secret -encode -claims='{"user_id":111}'`
Output: `eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoxMTF9._cLJn0xFS0Mdr_4L_8XF8-8tv7bHyOQJXyWaNsSqlEs`
# LICENSE # LICENSE
[MIT](/LICENSE) [MIT](/LICENSE)

View file

@ -65,7 +65,7 @@ import (
"github.com/go-chi/chi/v5" "github.com/go-chi/chi/v5"
"github.com/go-chi/jwtauth/v5" "github.com/go-chi/jwtauth/v5"
"github.com/lestrrat-go/jwx/jwt" "github.com/lestrrat-go/jwx/v2/jwt"
) )
var tokenAuth *jwtauth.JWTAuth var tokenAuth *jwtauth.JWTAuth