diff options
author | cpasjuste <cpasjuste@gmail.com> | 2020-04-25 09:13:02 +0200 |
---|---|---|
committer | cpasjuste <cpasjuste@gmail.com> | 2020-04-25 09:13:02 +0200 |
commit | 82735cd2e2d11376fc4f2576542f0f578bb3ed7a (patch) | |
tree | d32e267eddebaa7d89e525e7122864ca3acc7431 /src/net/ea | |
parent | c4fad09b3d29679b15d456f6cc0d61b0f59a8d4c (diff) | |
download | manaverse-82735cd2e2d11376fc4f2576542f0f578bb3ed7a.tar.gz manaverse-82735cd2e2d11376fc4f2576542f0f578bb3ed7a.tar.bz2 manaverse-82735cd2e2d11376fc4f2576542f0f578bb3ed7a.tar.xz manaverse-82735cd2e2d11376fc4f2576542f0f578bb3ed7a.zip |
add "SAVE_PASSWORD" define option
Diffstat (limited to 'src/net/ea')
-rw-r--r-- | src/net/ea/loginhandler.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/net/ea/loginhandler.cpp b/src/net/ea/loginhandler.cpp index 88b085aa3..92a2e9f35 100644 --- a/src/net/ea/loginhandler.cpp +++ b/src/net/ea/loginhandler.cpp @@ -151,15 +151,23 @@ void LoginHandler::loginOrRegister(LoginData *const data) const else loginAccount(data); - // Clear the password, avoids auto login when returning to login - data->password.clear(); - const bool remember = data->remember; - if (remember) + if (remember) { serverConfig.setValue("username", data->username); - else +#ifdef SAVE_PASSWORD + serverConfig.setValue("password", data->password); +#endif + } + else { serverConfig.setValue("username", ""); +#ifdef SAVE_PASSWORD + serverConfig.setValue("password", ""); +#endif + } serverConfig.setValue("remember", remember); + + // Clear the password, avoids auto login when returning to login + data->password.clear(); } void LoginHandler::logout() const |