Update go-chi/jwtauth to v3.3 and remove dgrijalva from direct dependencies

This commit is contained in:
Alex Frank Adhyatma 2019-03-07 11:55:45 +00:00
parent 83b738e298
commit a2d51bbfd8
No known key found for this signature in database
GPG key ID: 3AE15EAFE5BAFD5E
7 changed files with 27 additions and 28 deletions

View file

@ -2,8 +2,7 @@ package jwt
import (
"errors"
"github.com/dgrijalva/jwt-go"
"github.com/go-chi/jwtauth"
)
// AppClaims represent the claims parsed from JWT access token.
@ -14,7 +13,7 @@ type AppClaims struct {
}
// ParseClaims parses JWT claims into AppClaims.
func (c *AppClaims) ParseClaims(claims jwt.MapClaims) error {
func (c *AppClaims) ParseClaims(claims jwtauth.Claims) error {
id, ok := claims["id"]
if !ok {
return errors.New("could not parse claim id")
@ -49,7 +48,7 @@ type RefreshClaims struct {
}
// ParseClaims parses the JWT claims into RefreshClaims.
func (c *RefreshClaims) ParseClaims(claims jwt.MapClaims) error {
func (c *RefreshClaims) ParseClaims(claims jwtauth.Claims) error {
token, ok := claims["token"]
if !ok {
return errors.New("could not parse claim token")