Fix dave's retard
This commit is contained in:
@@ -97,7 +97,7 @@ func (s *SSO) initDB() error {
|
||||
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 token is expired, it will refresh it automatically
|
||||
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
|
||||
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)
|
||||
if err := s.refreshToken(ctx, char); err != nil {
|
||||
logger.Warning("Token refresh failed for character %s, re-authenticating: %v", characterName, err)
|
||||
|
||||
Reference in New Issue
Block a user