Skip to content

fix: JSON password field uses wrong variable (copy-paste bug)#48

Merged
WinterSolstice8 merged 1 commit into
LandSandBoat:mainfrom
phoenixffxi:fix/json-password-copypaste
Feb 28, 2026
Merged

fix: JSON password field uses wrong variable (copy-paste bug)#48
WinterSolstice8 merged 1 commit into
LandSandBoat:mainfrom
phoenixffxi:fix/json-password-copypaste

Conversation

@Shuu-37

@Shuu-37 Shuu-37 commented Feb 28, 2026

Copy link
Copy Markdown
Contributor

Summary

One-line fix for a copy-paste bug in --json mode that causes login to always fail.

The Bug

In main.cpp line 570, g_Password is set from maybeUsername instead of maybePassword:

auto maybeUsername = jsonGet<std::string>(jsonData, "username");
auto maybePassword = jsonGet<std::string>(jsonData, "password");

globals::g_Username = maybeUsername.value_or(globals::g_Username);
globals::g_Password = maybeUsername.value_or(globals::g_Password);  // BUG

This silently sets the password to the username when using --json mode, so authentication always fails.

The Fix

- globals::g_Password = maybeUsername.value_or(globals::g_Password);
+ globals::g_Password = maybePassword.value_or(globals::g_Password);

Impact

Anyone using --json mode for automated/launcher login is affected. CLI --user/--pass args are not affected (they use a separate code path).

…N parsing

Copy-paste bug on line 570: when using --json mode, g_Password was being set from maybeUsername instead of maybePassword, causing login to always fail because password == username.
@WinterSolstice8 WinterSolstice8 merged commit b663949 into LandSandBoat:main Feb 28, 2026
1 check passed
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