feat(network): a clear auth-failed node banner with a fix-it action
When the node rejects the wallet's RPC login (bad rpcuser/rpcpassword), the
status bar showed developer jargon ("Auth failed — check rpcuser/rpcpassword")
and the only action was Reconnect, which just repeats the failure. Now a
dedicated AuthFailed banner reason surfaces "Wallet can't sign in to the node"
with a plain-language detail and a real fix: Restart node for the embedded
daemon (regenerates its cookie creds) or Open config folder for an external one
(to fix DRAGONX.conf). Driven by a new rpc_auth_failed_ flag (set on the auth
path, cleared on each connect attempt), with evaluator unit tests.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -406,6 +406,7 @@ void App::tryConnect()
|
||||
++connect_attempt;
|
||||
|
||||
connection_in_progress_ = true;
|
||||
rpc_auth_failed_ = false; // re-arm: a fresh connect attempt clears any prior auth failure
|
||||
connection_status_ = TR("sb_loading_config");
|
||||
|
||||
// Auto-detect configuration (file I/O — fast, safe on main thread)
|
||||
@@ -608,6 +609,7 @@ void App::tryConnect()
|
||||
} else {
|
||||
state_.connected = false;
|
||||
connection_status_ = TR("sb_auth_failed");
|
||||
rpc_auth_failed_ = true;
|
||||
VERBOSE_LOGF("[connect #%d] .cookie auth also failed\n", attempt);
|
||||
ui::Notifications::instance().error(
|
||||
"RPC authentication failed (HTTP 401). "
|
||||
@@ -621,6 +623,7 @@ void App::tryConnect()
|
||||
state_.connected = false;
|
||||
std::string confPath = rpc::Connection::getDefaultConfPath();
|
||||
connection_status_ = TR("sb_auth_failed");
|
||||
rpc_auth_failed_ = true;
|
||||
VERBOSE_LOGF("[connect #%d] HTTP 401 — rpcuser/rpcpassword in %s don't match the daemon. "
|
||||
"Edit the file or restart the daemon to regenerate credentials.\n",
|
||||
attempt, confPath.c_str());
|
||||
|
||||
Reference in New Issue
Block a user