Skip to content

Update to jwt-go v3.x, improve the API

Compare
Choose a tag to compare
@VojtechVitek VojtechVitek released this 06 Jul 22:42
· 52 commits to master since this release

Breaking release:

  • Update to github.com/dgrijalva/jwt-go v3.x
  • Update example code to use github.com/go-chi/chi v3.x
  • API changes
- func (ja *JwtAuth) SetContext(ctx context.Context, t *jwt.Token, err error) context.Context
+ func NewContext(ctx context.Context, t *jwt.Token, err error) context.Context

- func (ja *JwtAuth) IsExpired(t *jwt.Token) bool
+ func IsExpired(t *jwt.Token) bool

- func (ja *JwtAuth) Verifier(next http.Handler) http.Handler
+ func Verifier(ja *JwtAuth) func(http.Handler) http.Handler

+ func FromContext(ctx context.Context) (*jwt.Token, Claims, error)

See the latest godoc or the example.