mirror of
https://github.com/debauchee/barrier.git
synced 2026-07-11 22:36:05 +08:00
@@ -160,20 +160,17 @@ ArgParser::parsePlatformArg(ArgsBase& argsBase, const int& argc, const char* con
|
||||
bool
|
||||
ArgParser::parseToolArgs(ToolArgs& args, int argc, const char* const* argv)
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
for (int i = 1; i < argc; ++i) {
|
||||
if (isArg(i, argc, argv, NULL, "--get-active-desktop", 0)) {
|
||||
args.m_printActiveDesktopName = true;
|
||||
result = true;
|
||||
return true;
|
||||
}
|
||||
if (isArg(i, argc, argv, NULL, "--login-auth", 0)) {
|
||||
args.m_loginAuthenticate = true;
|
||||
result = true;
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
|
||||
@@ -29,8 +29,6 @@
|
||||
#include "platform/MSWindowsSession.h"
|
||||
#endif
|
||||
|
||||
#define PREMIUM_AUTH_URL "https://synergy-project.org/premium/json/auth/"
|
||||
|
||||
enum {
|
||||
kErrorOk,
|
||||
kErrorArgs,
|
||||
@@ -67,9 +65,6 @@ ToolApp::run(int argc, char** argv)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else if (m_args.m_loginAuthenticate) {
|
||||
loginAuth();
|
||||
}
|
||||
else {
|
||||
throw XSynergy("Nothing to do");
|
||||
}
|
||||
@@ -90,21 +85,3 @@ void
|
||||
ToolApp::help()
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
ToolApp::loginAuth()
|
||||
{
|
||||
String credentials;
|
||||
std::cin >> credentials;
|
||||
|
||||
size_t separator = credentials.find(':');
|
||||
String email = credentials.substr(0, separator);
|
||||
String password = credentials.substr(separator + 1, credentials.length());
|
||||
|
||||
std::stringstream ss;
|
||||
ss << PREMIUM_AUTH_URL;
|
||||
ss << "?email=" << ARCH->internet().urlEncode(email);
|
||||
ss << "&password=" << password;
|
||||
|
||||
std::cout << ARCH->internet().get(ss.str()) << std::endl;
|
||||
}
|
||||
|
||||
@@ -26,10 +26,6 @@ class ToolApp : public MinimalApp
|
||||
public:
|
||||
UInt32 run(int argc, char** argv);
|
||||
void help();
|
||||
|
||||
private:
|
||||
void loginAuth();
|
||||
|
||||
private:
|
||||
ToolArgs m_args;
|
||||
};
|
||||
|
||||
@@ -25,5 +25,4 @@ public:
|
||||
|
||||
public:
|
||||
bool m_printActiveDesktopName;
|
||||
bool m_loginAuthenticate;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user