hGetAll($k); if (!is_array($h) || empty($h['uid']) || empty($h['hash'])) { $error = 'Reset link has expired or is invalid.'; } elseif (!hash_equals((string)$h['hash'], token_hash($token))) { $error = 'Invalid reset token.'; } elseif ($_SERVER['REQUEST_METHOD'] === 'POST') { $pass1 = (string)($_POST['password'] ?? ''); $pass2 = (string)($_POST['password2'] ?? ''); if ($pass1 === '' || strlen($pass1) < 6) { $error = 'Password must be at least 6 characters.'; } elseif ($pass1 !== $pass2) { $error = 'Passwords do not match.'; } else { $uid = (string)$h['uid']; redis()->hSet(acct_key($uid), 'password_hash', password_hash($pass1, PASSWORD_DEFAULT)); redis()->del($k); $done = true; } } } function he(string $s): string { return htmlspecialchars($s, ENT_QUOTES, 'UTF-8'); } ?> Reset Password — SvxPortal

Reset Password

Password changed successfully!

Back to SvxPortal

Back to SvxPortal