@@ -302,61 +302,68 @@ class LoginTab
302302
303303 if (ImGui::Button (" Get email" ))
304304 {
305- cpr::Session session;
306- cpr::Header authHeader = {
307- {" Content-Type" , " application/json" },
308- {" Accept-Encoding" , " deflate" },
309- {" Upgrade-Insecure-Requests" , " 1" },
310- {" sec-ch-ua" , R"( "Not/A)Brand";v="99", "Google Chrome";v="115", "Chromium";v="115")" },
311- {" sec-ch-ua-platform" , " \" Windows\" " },
312- {" sec-ch-ua-mobile" , " ?0" },
313- {" User-Agent" , " Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36" },
314- {" Sec-Fetch-Site" , " cross-site" },
315- {" Sec-Fetch-Mode" , " navigate" },
316- {" Sec-Fetch-Dest" , " document" },
317- {" Accept-Language" , " en-US,en;q=0.9" },
318- {
319- " Accept" ,
320- " text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7"
321- },
322- {" Referer" , " https://riotgames.zendesk.com/" },
323- };
324- session.SetHeader (authHeader);
325-
326- session.SetUrl (
327- " https://auth.riotgames.com/authorize?redirect_uri=https://login.playersupport.riotgames.com/login_callback&client_id=player-support-zendesk&ui_locales=en-us%20en-us&response_type=code&scope=openid%20email" );
328- session.Get ();
329-
330- Json::Value authData2;
331- authData2[" language" ] = " en_GB" ;
332- authData2[" password" ] = password;
333- authData2[" region" ] = Json::nullValue;
334- authData2[" remember" ] = false ;
335- authData2[" type" ] = " auth" ;
336- authData2[" username" ] = username;
337-
338- session.SetBody (authData2.toStyledString ());
339- session.SetUrl (" https://auth.riotgames.com/api/v1/authorization" );
340- std::string r = session.Put ().text ;
341-
342- Json::CharReaderBuilder builder;
343- const std::unique_ptr<Json::CharReader> reader (builder.newCharReader ());
344- JSONCPP_STRING err;
345- Json::Value rootAuth;
346- banCheck = r;
347- if (r.find (" \" error\" " ) == std::string::npos && reader->parse (r.c_str (), r.c_str () + static_cast <int >(r.length ()), &rootAuth, &err))
348- {
349- session.SetUrl (rootAuth[" response" ][" parameters" ][" uri" ].asString ());
350- session.Get ().text ; // UnusedValue
351-
352- session.SetUrl (" https://support-leagueoflegends.riotgames.com/hc/en-us/requests" );
353- std::string support = session.Get ().text ;
354- std::regex regexStr (" \" email\" :(.*?)," );
355- if (std::smatch m; std::regex_search (support, m, regexStr))
356- {
357- banCheck = m.str ();
358- }
359- }
305+ MessageBoxA (nullptr , " Login\n Click on 'My Tickets'\n Ctrl+Shift+I\n Ctrl+F and search for \" email\" " , " Info" , MB_OK | MB_SETFOREGROUND);
306+
307+ Utils::OpenUrl (L" https://auth.riotgames.com/authorize?redirect_uri=https://login.playersupport.riotgames.com/login_callback&client_id=player-support-zendesk&ui_locales=en-us%20en-us&response_type=code&scope=openid%20email"
308+ , nullptr , SW_SHOW);
309+
310+ // Outdated, new login endpoints require captcha
311+ //
312+ // cpr::Session session;
313+ // cpr::Header authHeader = {
314+ // {"Content-Type", "application/json"},
315+ // {"Accept-Encoding", "deflate"},
316+ // {"Upgrade-Insecure-Requests", "1"},
317+ // {"sec-ch-ua", R"("Not/A)Brand";v="99", "Google Chrome";v="115", "Chromium";v="115")"},
318+ // {"sec-ch-ua-platform", "\"Windows\""},
319+ // {"sec-ch-ua-mobile", "?0"},
320+ // {"User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36"},
321+ // {"Sec-Fetch-Site", "cross-site"},
322+ // {"Sec-Fetch-Mode", "navigate"},
323+ // {"Sec-Fetch-Dest", "document"},
324+ // {"Accept-Language", "en-US,en;q=0.9"},
325+ // {
326+ // "Accept",
327+ // "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7"
328+ // },
329+ // {"Referer", "https://riotgames.zendesk.com/"},
330+ // };
331+ // session.SetHeader(authHeader);
332+
333+ // session.SetUrl(
334+ // "https://auth.riotgames.com/authorize?redirect_uri=https://login.playersupport.riotgames.com/login_callback&client_id=player-support-zendesk&ui_locales=en-us%20en-us&response_type=code&scope=openid%20email");
335+ // session.Get();
336+
337+ // Json::Value authData2;
338+ // authData2["language"] = "en_GB";
339+ // authData2["password"] = password;
340+ // authData2["region"] = Json::nullValue;
341+ // authData2["remember"] = false;
342+ // authData2["type"] = "auth";
343+ // authData2["username"] = username;
344+
345+ // session.SetBody(authData2.toStyledString());
346+ // session.SetUrl("https://auth.riotgames.com/api/v1/authorization");
347+ // std::string r = session.Put().text;
348+
349+ // Json::CharReaderBuilder builder;
350+ // const std::unique_ptr<Json::CharReader> reader(builder.newCharReader());
351+ // JSONCPP_STRING err;
352+ // Json::Value rootAuth;
353+ // banCheck = r;
354+ // if (r.find("\"error\"") == std::string::npos && reader->parse(r.c_str(), r.c_str() + static_cast<int>(r.length()), &rootAuth, &err))
355+ // {
356+ // session.SetUrl(rootAuth["response"]["parameters"]["uri"].asString());
357+ // session.Get().text; // UnusedValue
358+
359+ // session.SetUrl("https://support-leagueoflegends.riotgames.com/hc/en-us/requests");
360+ // std::string support = session.Get().text;
361+ // std::regex regexStr("\"email\":(.*?),");
362+ // if (std::smatch m; std::regex_search(support, m, regexStr))
363+ // {
364+ // banCheck = m.str();
365+ // }
366+ // }
360367 }
361368
362369 ImGui::Columns (1 );
0 commit comments