Skip to content

Commit b45afe9

Browse files
committed
当用户不存在时,拉黑前端的token
1 parent 1e85e03 commit b45afe9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

server/middleware/jwt.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ func JWTAuth() gin.HandlerFunc {
4242
return
4343
}
4444
if err, _ = service.FindUserByUuid(claims.UUID.String()); err != nil {
45+
_ = service.JsonInBlacklist(model.JwtBlacklist{Jwt: token})
4546
response.FailWithDetailed(gin.H{"reload": true}, err.Error(), c)
4647
c.Abort()
4748
}

0 commit comments

Comments
 (0)