Skip to content

Commit 740f8b8

Browse files
committed
fix: abort when token err
1 parent dc69b92 commit 740f8b8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

biz/api/middleware/token.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func ExtractTokenInfoMW() app.HandlerFunc {
1717
if str != "" {
1818
info, err := token.ParseJWT(conf.GetConfig().Token, str)
1919
if err != nil {
20-
ctx.String(http.StatusUnauthorized, err.Error())
20+
ctx.AbortWithMsg(err.Error(), http.StatusUnauthorized)
2121
return
2222
}
2323
ctxcache.Store(c, cst.TokenInfo, info)

0 commit comments

Comments
 (0)