MCPcopy Create free account
hub / github.com/WarmUpTill/SceneSwitcher / getHtml

Function getHtml

plugins/twitch/token.cpp:764–790  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

762}
763
764static std::string getHtml(const QString &redirect)
765{
766 QString html = R"(
767 <html>
768 <head>
769 <title>Advanced scene switcher</title>
770 </head>
771 <body>
772 <div id="output">Please click this link to continue if not automatically redirected</div>
773 <p><a href="%1">Login with Twitch</a></a></p>
774 <script type="text/javascript">
775 if (document.location.hash && document.location.hash != '') {
776 var parsedHash = new URLSearchParams(window.location.hash.slice(1));
777 if (parsedHash.get('access_token')) {
778 window.location.replace(`http://localhost:%1/token?access_token=${parsedHash.get('access_token')}&state=${parsedHash.get('state')}`);
779 output.textContent = 'It is safe to close this window';
780 }
781 } else {
782 window.location.replace('%2');
783 }
784 </script>
785 </body>
786 </html>)";
787
788 return html.arg(QString::number(tokenGrabberPort), redirect)
789 .toStdString();
790}
791
792void TwitchTokenSettingsDialog::RequestToken()
793{

Callers 1

runMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected