From 57efa146d9954bbc13fd2b4ece46f3ccce4480ba Mon Sep 17 00:00:00 2001 From: Anton Afanasyeu Date: Tue, 23 Jun 2026 18:37:23 +0200 Subject: [PATCH] auth: shorten verify-email URLs via url shortener before send Outbound registration mail uses ShortLinksRepository::shortenForOutbound (s.f0xx.org) with 24h TTL; falls back to long URL if shortener unavailable. Co-authored-by: Cursor --- src/AuthMailer.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/AuthMailer.php b/src/AuthMailer.php index c6d3168..eb9e6cf 100644 --- a/src/AuthMailer.php +++ b/src/AuthMailer.php @@ -18,7 +18,10 @@ final class AuthMailer { public static function sendVerifyEmail(string $to, string $verifyUrl): bool { $subject = 'Verify your Android Cast account'; - $body = "Open this link to verify your email (valid 24h):\n\n" . $verifyUrl . "\n"; + $link = class_exists('ShortLinksRepository', false) + ? ShortLinksRepository::shortenForOutbound($verifyUrl, 86400) + : $verifyUrl; + $body = "Open this link to verify your email (valid 24h):\n\n" . $link . "\n"; return self::send($to, $subject, $body); }