From 82735cd2e2d11376fc4f2576542f0f578bb3ed7a Mon Sep 17 00:00:00 2001 From: cpasjuste Date: Sat, 25 Apr 2020 09:13:02 +0200 Subject: add "SAVE_PASSWORD" define option --- src/net/ea/loginhandler.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'src/net/ea') 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 -- cgit v1.2.3-70-g09d2