mirror of
https://github.com/tiennm99/coolify.git
synced 2026-08-05 18:24:01 +00:00
refactor: use random_int() for email change verification codes
Replace mt_rand/rand with random_int for stronger randomness guarantees in verification code generation and Blade component keying. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
e39678aea5
commit
f493b96be3
+1
-1
@@ -395,7 +395,7 @@ class User extends Authenticatable implements SendsEmail
|
||||
public function requestEmailChange(string $newEmail): void
|
||||
{
|
||||
// Generate 6-digit code
|
||||
$code = sprintf('%06d', mt_rand(0, 999999));
|
||||
$code = sprintf('%06d', random_int(0, 999999));
|
||||
|
||||
// Set expiration using config value
|
||||
$expiryMinutes = config('constants.email_change.verification_code_expiry_minutes', 10);
|
||||
|
||||
Reference in New Issue
Block a user