🐛 Fix cannot refresh token

This commit is contained in:
LittleSheep 2024-02-01 23:31:00 +08:00
parent e5641b8068
commit 902650f11d

View File

@ -148,7 +148,7 @@ func RefreshToken(token string) (string, string, error) {
} else if claims.Type != JwtRefreshType {
return "404", "403", fmt.Errorf("invalid token type, expected refresh token")
} else if err := database.C.Where(models.AuthSession{
BaseModel: models.BaseModel{ID: uint(parseInt(claims.Subject))},
BaseModel: models.BaseModel{ID: uint(parseInt(claims.SessionID))},
}).First(&session).Error; err != nil {
return "404", "403", err
}