summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2021-11-03 20:32:53 +0530
committerGitHub <noreply@github.com>2021-11-03 20:32:53 +0530
commit52f4ce06f533ffc4f0eb0031801f52d3ebdab595 (patch)
tree12173ce09d58edbee7315b106cd8629a19821db0 /app
parent2cf3ddf2aadad011f62ecafbbbf939fd0104cb43 (diff)
Allow unauthenticated HTTPS Git access (#1533)
Diffstat (limited to 'app')
-rw-r--r--app/src/main/java/dev/msfjarvis/aps/util/settings/GitSettings.kt4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/src/main/java/dev/msfjarvis/aps/util/settings/GitSettings.kt b/app/src/main/java/dev/msfjarvis/aps/util/settings/GitSettings.kt
index 072c1c1c..e6915853 100644
--- a/app/src/main/java/dev/msfjarvis/aps/util/settings/GitSettings.kt
+++ b/app/src/main/java/dev/msfjarvis/aps/util/settings/GitSettings.kt
@@ -149,7 +149,9 @@ constructor(
in listOf("ssh", null) -> Protocol.Ssh
else -> return UpdateConnectionSettingsResult.FailedToParseUrl
}
- if (newAuthMode != AuthMode.None && parsedUrl.user.isNullOrBlank())
+ if ((newAuthMode != AuthMode.None && newProtocol != Protocol.Https) &&
+ parsedUrl.user.isNullOrBlank()
+ )
return UpdateConnectionSettingsResult.MissingUsername(newProtocol)
val validHttpsAuth = listOf(AuthMode.None, AuthMode.Password)
val validSshAuth = listOf(AuthMode.OpenKeychain, AuthMode.Password, AuthMode.SshKey)