fix(auth): fetch server-issued login code via GET /LoginCode - #3
Open
falhenaki wants to merge 1 commit into
Open
fix(auth): fetch server-issued login code via GET /LoginCode#3falhenaki wants to merge 1 commit into
falhenaki wants to merge 1 commit into
Conversation
falhenaki
force-pushed
the
fix/login-server-issued-code
branch
from
August 29, 2026 03:49
1b32321 to
372b282
Compare
The GeneralsOnline services backend registers login codes server-side (GET /LoginCode -> PendingLoginManager.AddPendingLogin) and only accepts a code it issued: the web/Discord callback's POST /LoginCode updates a pre-registered code, and CheckLogin returns FAILED (HTTP 403) for any code the server never issued. This client generated the gamecode locally (GenerateGamecode) and never called GET /LoginCode, so the code was never registered. CheckLogin then returned result:2 on the first poll while the browser still showed "Welcome Back" (the Discord OAuth half succeeds independently), which looks exactly like a broken account. Online login could never complete. Add BeginInteractiveLogin(): fetch the code from the server, then use it for the browser URL and CheckLogin polling. BeginLogin (no cached token) and DoReAuth now route through it, matching the upstream GOD Team client. Verified against api.playgenerals.online: GET /LoginCode -> CheckLogin result:0 (WAITING) -> result:1 (SUCCESS) after Discord auth; an unregistered local code still returns result:2.
falhenaki
force-pushed
the
fix/login-server-issued-code
branch
from
August 29, 2026 03:51
372b282 to
edfa9fe
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Online login never completes on this macOS port. The browser shows "Welcome Back, " but the game reports login failed and returns to the menu.
Root cause
The GeneralsOnline services backend now issues and registers login codes server-side (
GET /LoginCode→PendingLoginManager.AddPendingLogin).CheckLoginreturnsresult:2(HTTP 403) for any code the server didn't issue, and the web/Discord callback'sPOST /LoginCodeonly updates a pre-registered code.This client still generated the gamecode locally (
GenerateGamecode()) and never calledGET /LoginCode, so:CheckLoginreturnedresult:2on the very first poll (instant "login failed");Result: online login could never complete on this port.
Fix
Add
BeginInteractiveLogin(): fetch the server-issued code viaGET /LoginCode, then use that code for the browser URL andCheckLoginpolling.BeginLogin(no cached refresh token) andDoReAuthnow route through it. This matches the upstream GeneralsOnlineDevelopmentTeam client flow. Self-contained; macOS browser-open path (open) preserved.Verification (against
api.playgenerals.online, prod)GET /LoginCode→CheckLogin=result:0(WAITING), not 403result:1(SUCCESS) with session/refresh tokens +ws_uriresult:2(403)Built clean for the macOS target.