fix(api-tokens): mark expiration warning after notification

Ensure failed token expiration warning notifications do not persist the warning marker, allowing the job to retry later.
This commit is contained in:
Andras Bacsai committed 2026-05-13 10:28:32 +02:00
1 parent 3911a0305c
commit 1522c510cf
2 files changed
+19 -1

No files matched your search

+3 -1
View File
@@ -42,6 +42,9 @@ class ApiTokenExpirationWarningJob implements ShouldBeEncrypted, ShouldQueue, Si
}
$warningSentAt = now();
$team->notify(new ApiTokenExpiringNotification($token));
$markedAsSent = PersonalAccessToken::query()
->whereKey($token->getKey())
->whereNotNull('expires_at')
@@ -55,7 +58,6 @@ class ApiTokenExpirationWarningJob implements ShouldBeEncrypted, ShouldQueue, Si
}
$token->forceFill(['api_token_expiration_warning_sent_at' => $warningSentAt]);
$team->notify(new ApiTokenExpiringNotification($token));
}
});
}