Skip to content

Commit 925c162

Browse files
authored
Update main.cpp
1 parent 5d50685 commit 925c162

File tree

1 file changed

+25
-9
lines changed

1 file changed

+25
-9
lines changed

x64/main.cpp

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include <thread>
55
#include "utils.hpp"
66
#include "skStr.h"
7+
#include <iostream>
78
std::string tm_to_readable_time(tm ctx);
89
static std::time_t string_to_timet(std::string timestamp);
910
static std::tm timet_to_tm(time_t timestamp);
@@ -15,11 +16,12 @@ using namespace KeyAuth;
1516

1617
// copy and paste from https://keyauth.cc/app/ and replace these string variables
1718
// Please watch tutorial HERE https://www.youtube.com/watch?v=5x4YkTmFH-U
18-
std::string name = skCrypt("name").decrypt();
19-
std::string ownerid = skCrypt("ownerid").decrypt();
20-
std::string version = skCrypt("1.0").decrypt();
19+
std::string name = skCrypt("name").decrypt(); // App name
20+
std::string ownerid = skCrypt("ownerid").decrypt(); // Account ID
21+
std::string version = skCrypt("1.0").decrypt(); // Application version. Used for automatic downloads see video here https://www.youtube.com/watch?v=kW195PLCBKs
2122
std::string url = skCrypt("https://keyauth.win/api/1.3/").decrypt(); // change if using KeyAuth custom domains feature
22-
std::string path = skCrypt("").decrypt(); //optional, set a path if you're using the token validation setting
23+
std::string path = skCrypt("").decrypt(); // (OPTIONAL) see tutorial here https://www.youtube.com/watch?v=I9rxt821gMk&t=1s
24+
2325

2426
api KeyAuthApp(name, ownerid, version, url, path);
2527

@@ -72,9 +74,7 @@ int main()
7274
std::cout << skCrypt("\n\n [1] Login\n [2] Register\n [3] Upgrade\n [4] License key only\n\n Choose option: ");
7375

7476
int option;
75-
std::string username;
76-
std::string password;
77-
std::string key;
77+
std::string username, password, key, TfaCode;
7878

7979
std::cin >> option;
8080
switch (option)
@@ -84,7 +84,9 @@ int main()
8484
std::cin >> username;
8585
std::cout << skCrypt("\n Enter password: ");
8686
std::cin >> password;
87-
KeyAuthApp.login(username, password);
87+
std::cout << skCrypt("\n Enter 2fa code if applicable: ");
88+
std::cin >> TfaCode;
89+
KeyAuthApp.login(username, password, TfaCode);
8890
break;
8991
case 2:
9092
std::cout << skCrypt("\n\n Enter username: ");
@@ -105,7 +107,9 @@ int main()
105107
case 4:
106108
std::cout << skCrypt("\n Enter license: ");
107109
std::cin >> key;
108-
KeyAuthApp.license(key);
110+
std::cout << skCrypt("\n Enter 2fa code if applicable: ");
111+
std::cin >> TfaCode;
112+
KeyAuthApp.license(key, TfaCode);
109113
break;
110114
default:
111115
std::cout << skCrypt("\n\n Status: Failure: Invalid Selection");
@@ -141,6 +145,14 @@ int main()
141145
// do NOT remove checkAuthenticated(), it MUST stay for security reasons
142146
std::thread check(sessionStatus); // do NOT remove this function either.
143147

148+
//enable 2FA
149+
// KeyAuthApp.enable2fa(); you will need to ask for the code
150+
//enable 2fa without the need of asking for the code
151+
//KeyAuthApp.enable2fa().handleInput(KeyAuthApp);
152+
153+
//disbale 2FA
154+
// KeyAuthApp.disable2fa();
155+
144156
if (KeyAuthApp.user_data.username.empty()) exit(10);
145157
std::cout << skCrypt("\n User data:");
146158
std::cout << skCrypt("\n Username: ") << KeyAuthApp.user_data.username;
@@ -156,6 +168,10 @@ int main()
156168
std::cout << skCrypt(" : expiry: ") << tm_to_readable_time(timet_to_tm(string_to_timet(sub.expiry)));
157169
}
158170

171+
172+
std::cout << skCrypt("\n\n Status: ") << KeyAuthApp.response.message;
173+
174+
159175
std::cout << skCrypt("\n\n Closing in five seconds...");
160176
Sleep(5000);
161177

0 commit comments

Comments
 (0)