~evanj/security

33f2ce3377d3da788dc0b4559338172afd665860 — Evan M Jones 2 years ago 9fbe7f1
Fix(errors): No uppercase in errors.
1 files changed, 2 insertions(+), 2 deletions(-)

M security.go
M security.go => security.go +2 -2
@@ 103,12 103,12 @@ func (sec Security) TokenFrom(tokenString string) (_ret TokenMap, recoverErr err
	defer func() {
		if recover() != nil {
			// That's right, jwt will pnic on bad input. Don't do this.
			recoverErr = errors.New("bogus hash; hash has no value")
			recoverErr = errors.New("hash has no value")
		}
	}()
	token, err := jwt.Parse(tokenString, func(token *jwt.Token) (interface{}, error) {
		if _, ok := token.Method.(*jwt.SigningMethodHMAC); !ok {
			return nil, fmt.Errorf("Unexpected signing method: %v", token.Header["alg"])
			return nil, fmt.Errorf("unexpected signing method: %v", token.Header["alg"])
		}
		return []byte(sec.secret), nil
	})