Skip to content

Commit 38a5315

Browse files
committed
fix(auth): replace localhost with 127.0.0.1 in ElyStep
Signed-off-by: so5iso4ka <[email protected]>
1 parent 61ff0e7 commit 38a5315

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

launcher/minecraft/auth/elyby/steps/ElyStep.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,13 @@ void ElyStep::perform()
128128
m_oauth2.refreshAccessToken();
129129
} else {
130130
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) // QMultiMap param changed in 6.0
131-
m_oauth2.setModifyParametersFunction(
132-
[](QAbstractOAuth::Stage stage, QMultiMap<QString, QVariant>* map) { map->insert("prompt", "select_account"); });
131+
m_oauth2.setModifyParametersFunction([](QAbstractOAuth::Stage stage, QMultiMap<QString, QVariant>* map) {
132+
map->insert("prompt", "select_account");
133+
if (const auto it = map->find("redirect_uri"); it != map->end()) {
134+
const auto host = it->toString().replace("localhost", "127.0.0.1");
135+
*it = host;
136+
}
137+
});
133138
#else
134139
m_oauth2.setModifyParametersFunction(
135140
[](QAbstractOAuth::Stage stage, QMap<QString, QVariant>* map) { map->insert("prompt", "select_account"); });

0 commit comments

Comments
 (0)