fix cf access login

This commit is contained in:
Purple
2026-01-18 02:01:34 +00:00
parent 73f744fe89
commit c0f0fa4d7b

View File

@@ -37,9 +37,12 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['action']) && $_POST['
$error = 'Invalid security token. Please try again.';
} elseif ($cfUser) {
// Session is already started by config.php
// Set all required session variables for isAuthenticated() to work
$_SESSION['authenticated'] = true;
$_SESSION['auth_token'] = bin2hex(random_bytes(32));
$_SESSION['auth_time'] = time();
$_SESSION['user'] = $cfUser['email'];
$_SESSION['login_time'] = time();
$_SESSION['username'] = $cfUser['email'];
// Clear output buffer and redirect
if (ob_get_level()) {
@@ -464,7 +467,7 @@ try {
</div>
</div>
<h1 class="login-title"><?= htmlspecialchars($appName) ?></h1>
<p class="login-subtitle">Sign in to manage your geofeed entries</p>
<p class="login-subtitle">Sign in to manage your IP assets</p>
</div>
<div class="login-body">