Merge pull request #190 from jamesrwhite/patch-1

Clarify hmacSampleSecret type
This commit is contained in:
Dave Grijalva 2017-01-04 10:22:50 -08:00 committed by GitHub
commit a601269ab7
1 changed files with 2 additions and 0 deletions

View File

@ -51,6 +51,8 @@ func ExampleParse_hmac() {
if _, ok := token.Method.(*jwt.SigningMethodHMAC); !ok { 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"])
} }
// hmacSampleSecret is a []byte containing your secret, e.g. []byte("my_secret_key")
return hmacSampleSecret, nil return hmacSampleSecret, nil
}) })