mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-05 16:14:08 +00:00
Add normalized email identity rate limiting for registration and forgot-password requests, and refresh Sentinel status from restart broadcasts. Rework server sidebars and navbar for mobile menus and active status visibility.
21 lines
457 B
PHP
21 lines
457 B
PHP
<?php
|
|
|
|
use Illuminate\Support\Str;
|
|
|
|
function normalize_email_identity(?string $email): ?string
|
|
{
|
|
if (blank($email) || ! str_contains($email, '@')) {
|
|
return null;
|
|
}
|
|
|
|
[$localPart, $domain] = explode('@', Str::lower($email), 2);
|
|
$localPart = Str::before($localPart, '+');
|
|
$localPart = str_replace('.', '', $localPart);
|
|
|
|
if (blank($localPart) || blank($domain)) {
|
|
return null;
|
|
}
|
|
|
|
return $localPart.'@'.$domain;
|
|
}
|