feat: invalidate old token after changing the password (close #5515)

This commit is contained in:
Andy Hsu
2023-11-13 15:22:42 +08:00
parent a7421d8fc2
commit 3d51845f57
6 changed files with 24 additions and 6 deletions

View File

@ -78,7 +78,7 @@ func loginHash(c *gin.Context, req *LoginReq) {
}
}
// generate token
token, err := common.GenerateToken(user.Username)
token, err := common.GenerateToken(user)
if err != nil {
common.ErrorResp(c, err, 400, true)
return