Skip to content

Commit afdb4f2

Browse files
authored
Forgot password by @Shxde1
Added Forgot function
2 parents 22c1cdc + d228543 commit afdb4f2

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

auth.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,6 +1059,19 @@ std::string KeyAuth::api::fetchonline()
10591059
return onlineusers;
10601060
}
10611061

1062+
void KeyAuth::api::forgot(std::string username, std::string email)
1063+
{
1064+
auto data =
1065+
XorStr("type=forgot") +
1066+
XorStr("&username=") + username +
1067+
XorStr("&email=") + email +
1068+
XorStr("&sessionid=") +sessionid +
1069+
XorStr("&name=") + name +
1070+
XorStr("&ownerid=") + ownerid;
1071+
auto response = req(data, url);
1072+
auto json = response_decoder.parse(response);
1073+
}
1074+
10621075
// credits https://stackoverflow.com/a/3790661
10631076
static std::string hexDecode(const std::string& hex)
10641077
{
@@ -1299,3 +1312,4 @@ void modify()
12991312
Sleep(50);
13001313
}
13011314
}
1315+

auth.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ namespace KeyAuth {
3939
bool chatsend(std::string message, std::string channel);
4040
void changeusername(std::string newusername);
4141
std::string fetchonline();
42+
void forgot(std::string username, std::string email);
4243

4344
class subscriptions_class {
4445
public:

0 commit comments

Comments
 (0)