fix compatibility with jwx 1.1.0 (#55)

This commit is contained in:
Nicola Murino 2021-01-31 22:35:32 +01:00 committed by GitHub
parent 38df5c8c2e
commit 52c0aa2d7c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 39 additions and 21 deletions

View file

@ -1,7 +1,6 @@
package jwtauth
import (
"bytes"
"context"
"errors"
"net/http"
@ -139,7 +138,7 @@ func (ja *JWTAuth) sign(token jwt.Token) ([]byte, error) {
}
func (ja *JWTAuth) parse(payload []byte) (jwt.Token, error) {
return jwt.Parse(bytes.NewReader(payload), ja.verifier)
return jwt.Parse(payload, ja.verifier)
}
// ErrorReason will normalize the error message from the underlining