prepare("SELECT * FROM users WHERE email = ? LIMIT 1"); $stmt->execute([$email]); $user = $stmt->fetch(); if ($user && password_verify($password, $user['password'])) { Auth::login((int)$user['id'], (int)$user['tenant_id'], (string)$user['role']); session_write_close(); header('Location: index.php', true, 302); exit; } else { $error = 'Invalid email or password.'; } } ?>
Sign in to your account