1
0
mirror of git://f0xx.org/ac/ac-ms-identity synced 2026-07-30 02:37:39 +03:00

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 <cursoragent@cursor.com>
This commit is contained in:
Anton Afanasyeu
2026-06-23 18:37:23 +02:00
parent 9c70fcad5f
commit 57efa146d9

View File

@@ -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);
}