diff options
author | jonkoorm <jonkoorm@users.noreply.gitlab.com> | 2021-10-24 15:54:49 -0500 |
---|---|---|
committer | jonkoorm <jonkoorm@users.noreply.gitlab.com> | 2021-10-24 16:07:26 -0500 |
commit | 4d3f49696ef96e78b8d1653c86b83b257f4dbec8 (patch) | |
tree | 81b0117d15984af28411f4dea3b4cfca72453984 /src/net/ea | |
parent | b47e02f1e70a1f303bee370110448d92bc0a3684 (diff) | |
download | manaverse-keep_password.tar.gz manaverse-keep_password.tar.bz2 manaverse-keep_password.tar.xz manaverse-keep_password.zip |
Enable password remembering in user loginkeep_password
Password is recorded in the 'password' option in config.xml
The 'remember_password' option is added to save the status
Diffstat (limited to 'src/net/ea')
-rw-r--r-- | src/net/ea/loginhandler.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/net/ea/loginhandler.cpp b/src/net/ea/loginhandler.cpp index 2fc177476..fbae0813f 100644 --- a/src/net/ea/loginhandler.cpp +++ b/src/net/ea/loginhandler.cpp @@ -153,21 +153,20 @@ void LoginHandler::loginOrRegister(LoginData *const data) const const bool remember = data->remember; if (remember) - { serverConfig.setValue("username", data->username); -#ifdef SAVE_PASSWORD - serverConfig.setValue("password", data->password); -#endif - } else - { serverConfig.setValue("username", ""); -#ifdef SAVE_PASSWORD - serverConfig.setValue("password", ""); -#endif - } + serverConfig.setValue("remember", remember); + const bool remember_password = data->remember_password; + if (remember_password) + serverConfig.setValue("password", data->password); + else + serverConfig.setValue("password", ""); + + serverConfig.setValue("remember_password", remember_password); + // Clear the password, avoids auto login when returning to login data->password.clear(); } |