mirror of
https://github.com/android-password-store/Android-Password-Store
synced 2025-08-31 14:25:28 +00:00
BaseGitActivity: don't remove saved password unnecessarily
if previousUrl is empty it means that this the first time the method is being called, and url has not been built yet. We let things slide for the first pass so that the actual logic only kicks in when it needs to. Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
@@ -126,7 +126,7 @@ abstract class BaseGitActivity : AppCompatActivity() {
|
||||
PasswordRepository.addRemote("origin", newUrl, true)
|
||||
// HTTPS authentication sends the password to the server, so we must wipe the password when
|
||||
// the server is changed.
|
||||
if (newUrl != previousUrl && protocol == Protocol.Https)
|
||||
if (previousUrl.isNotEmpty() && newUrl != previousUrl && protocol == Protocol.Https)
|
||||
encryptedSettings.edit { remove("https_password") }
|
||||
url = newUrl
|
||||
return true
|
||||
|
Reference in New Issue
Block a user