1
0
Fork 0
mirror of https://github.com/chrislusf/seaweedfs synced 2024-06-23 02:53:03 +02:00

fix compilation problem due to API changes

This commit is contained in:
Chris Lu 2016-06-18 18:57:33 -07:00
parent 18cf59c375
commit 356b8048c5

View file

@ -19,8 +19,10 @@ func GenJwt(secret Secret, fileId string) EncodedJwt {
}
t := jwt.New(jwt.GetSigningMethod("HS256"))
t.Claims["exp"] = time.Now().Unix() + 10
t.Claims["sub"] = fileId
t.Claims = &jwt.StandardClaims{
ExpiresAt: time.Now().Add(time.Second * 10).Unix(),
Subject: fileId,
}
encoded, e := t.SignedString(secret)
if e != nil {
glog.V(0).Infof("Failed to sign claims: %v", t.Claims)
@ -53,7 +55,7 @@ func GetJwt(r *http.Request) EncodedJwt {
return EncodedJwt(tokenStr)
}
func EncodeJwt(secret Secret, claims map[string]interface{}) (EncodedJwt, error) {
func EncodeJwt(secret Secret, claims *jwt.StandardClaims) (EncodedJwt, error) {
if secret == "" {
return "", nil
}