github: do not store password in memory provider if "save password" checkbox disabled

* password is stored in GithubAuthDataHolder during the sesion, so we will not ask for password multiple times
* this causes confusing behavior of settings configurable, when password disappears after IDE restart
This commit is contained in:
Aleksey Pivovarov
2016-08-02 16:52:05 +03:00
parent f69c8e2f94
commit 5655b5f7f0
@@ -170,7 +170,8 @@ public class GithubSettings implements PersistentStateComponent<GithubSettings.S
} }
private void setPassword(@NotNull String password, boolean rememberPassword) { private void setPassword(@NotNull String password, boolean rememberPassword) {
PasswordSafe.getInstance().setPassword(GithubSettings.class, GITHUB_SETTINGS_PASSWORD_KEY, password, !rememberPassword); if (!rememberPassword) return;
PasswordSafe.getInstance().setPassword(GithubSettings.class, GITHUB_SETTINGS_PASSWORD_KEY, password);
} }
private static boolean isValidGitAuth(@NotNull GithubAuthData auth) { private static boolean isValidGitAuth(@NotNull GithubAuthData auth) {