Skip to content

Commit

Permalink
Merge pull request #16 from SwanHubX/fix-jwt
Browse files Browse the repository at this point in the history
fix(jwt): exp field
  • Loading branch information
swpfY authored Nov 24, 2023
2 parents d7ff969 + eef1c3f commit 80dd8e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion preprocess.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func (p *Preprocess) parseJWT(req *http.Request) {
}
// 3. 验证jwt凭证是否过期
var v map[string]interface{}
if err = json.Unmarshal(payload, &v); err != nil {
if err = json.Unmarshal(payload, &v); err != nil || v["exp"] == nil {
return
}
exp := int64(math.Floor(v["exp"].(float64)))
Expand Down

0 comments on commit 80dd8e6

Please sign in to comment.