Fix dave's retard

This commit is contained in:
2025-10-10 22:01:24 +02:00
parent 6ffb7b4de0
commit ba455786aa

View File

@@ -97,7 +97,7 @@ func (s *SSO) initDB() error {
return nil return nil
} }
// GetToken returns a valid access token for the given character name // GetCharacter returns a valid character object for the given character name
// If no token exists, it will start the OAuth flow // If no token exists, it will start the OAuth flow
// If token is expired, it will refresh it automatically // If token is expired, it will refresh it automatically
func (s *SSO) GetCharacter(ctx context.Context, characterName string) (Character, error) { func (s *SSO) GetCharacter(ctx context.Context, characterName string) (Character, error) {
@@ -128,7 +128,7 @@ func (s *SSO) GetCharacter(ctx context.Context, characterName string) (Character
} }
// Check if token needs refresh // Check if token needs refresh
if time.Now().After(char.ExpiresAt.Add(-12 * time.Hour)) { if time.Now().After(char.ExpiresAt.Add(-1 * time.Minute)) {
logger.Info("Token for character %s is expired or expiring soon, refreshing", characterName) logger.Info("Token for character %s is expired or expiring soon, refreshing", characterName)
if err := s.refreshToken(ctx, char); err != nil { if err := s.refreshToken(ctx, char); err != nil {
logger.Warning("Token refresh failed for character %s, re-authenticating: %v", characterName, err) logger.Warning("Token refresh failed for character %s, re-authenticating: %v", characterName, err)