Skip to content

Conversation

@dudantas
Copy link
Collaborator

@dudantas dudantas commented Nov 20, 2025

This pull request introduces multi-server configuration support and implements two-factor authentication (2FA) for login, along with improvements to account credential management and error handling. The most important changes are grouped below.

Multi-server configuration and management:

  • Added a new Servers_init configuration system in init.lua, allowing clients to easily switch between multiple servers and worlds from a single installation. This includes an ENABLE_SERVERS flag to enable/disable the entire configuration block and per-server settings such as port, protocol, and authentication options. (init.lua init.luaL12-R84)

Two-factor authentication (2FA) integration:

  • Introduced a new UI window for entering authentication tokens (authenticatortoken.otui), and added logic to prompt users for a token when required, including error handling for incorrect tokens. (authenticatortoken.otui [1] entergame.lua [2] [3] [4]
  • Updated the login flow to support passing an authentication token to the backend, including changes to the HTTP login function signature and logic for token entry and error feedback. (meta.lua [1] entergame.lua [2] [3]

Account credential management improvements:

  • Credentials are now stored and retrieved per-server, encrypted, and managed via the ServerList module. The UI updates automatically based on stored credentials, and the "Remember Email" checkbox is now server-specific. (entergame.lua [1] [2] [3] [4] [5] [6]
  • Added a safeDecrypt helper to robustly handle decryption failures when loading credentials. (entergame.lua modules/client_entergame/entergame.luaR3-R7)

UI and error handling enhancements:

  • Improved error handling for authentication failures, including displaying error dialogs and managing focus for the token entry window. (entergame.lua [1] [2]
  • Refactored and cleaned up legacy code related to authentication token toggling and removed unused UI logic, simplifying the codebase. (entergame.lua [1] [2]

Server list and autologin support:

  • Added logic to load and show the server list UI, and improved autologin support by saving autologin preferences per server. (entergame.lua [1] [2]

Introduces two-factor authentication (2FA) for login via a new token input window and related UI changes. Updates server configuration to enable/disable authenticator per server, modifies login flow to handle token entry and error feedback, and passes the token to HTTP login requests in both Lua and C++. Refactors server list management to securely store account/password per server, and improves error handling and response parsing in HTTP login. Also adds a method to persist settings and fixes OTML parser edge cases for URLs ending with colons.
@dudantas dudantas changed the title Add two-factor authentication support to login feat: addd two-factor authentication support to login Nov 20, 2025
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot
7.2% Duplication on New Code (required ≤ 3%)
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +639 to +642
local host, path = G.host, "/"
if G.host:find("https?://") then
local url = G.host:gsub("https?://", "")
host, path = url:match("([^/]+)(/.*)")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Parse HTTP login path when host lacks scheme

The new HTTP login parsing only splits host/path when the host string starts with http:// or https://. For hosts entered without a scheme (e.g. example.com/login.php), path now stays /, so the login request goes to the root instead of login.php. The previous logic parsed any host containing a slash, so existing configurations without a scheme will now fail to authenticate. Consider extracting the path whenever a slash is present, not only when a scheme is prefixed.

Useful? React with 👍 / 👎.

@dudantas dudantas changed the title feat: addd two-factor authentication support to login feat: add two-factor authentication support to login Nov 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants