check refresh token expiration

This commit is contained in:
mqf20 2025-01-26 23:23:41 +08:00
parent 7593dcfa74
commit 82b1b70535
No known key found for this signature in database

View file

@ -615,6 +615,9 @@ func (s *Storage) renewRefreshToken(currentRefreshToken string) (string, string,
break
}
}
if refreshToken.Expiration.After(time.Now()) {
return "", "", fmt.Errorf("expired refresh token")
}
// creates a new refresh token based on the current one
token := uuid.NewString()
refreshToken.Token = token