Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aa9221bd authored by Mohammed Althaf T's avatar Mohammed Althaf T 😊
Browse files

test2

test

test
parent ed5d22ad
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -196,6 +196,10 @@ class HttpClient private constructor(

        fun addAuthentication(host: String?, credentials: Credentials, insecurePreemptive: Boolean = false, account: Account? = null, authStateCallback: BearerAuthInterceptor.AuthStateUpdateCallback? = null): Builder {
            if (credentials.userName != null && credentials.password != null) {
                Logger.log.log(Level.WARNING, "hostToDomain: ${UrlUtils.hostToDomain(host)}")
                Logger.log.log(Level.WARNING, "userName: ${credentials.userName}")
                Logger.log.log(Level.WARNING, "password: ${credentials.password}")
                Logger.log.log(Level.WARNING, "insecurePreemptive: $insecurePreemptive")
                val authHandler = BasicDigestAuthHandler(UrlUtils.hostToDomain(host), credentials.userName, credentials.password, insecurePreemptive)
                orig.addNetworkInterceptor(authHandler)
                    .authenticator(authHandler)
+4 −0
Original line number Diff line number Diff line
@@ -385,6 +385,10 @@ abstract class SyncManager<ResourceType: LocalResource<*>, out CollectionType: L
                is UnauthorizedException -> {
                    Logger.log.log(Level.WARNING, "Got 401 Unauthorized", e)
                    val credentials = accountSettings.credentials()
                    Logger.log.log(Level.WARNING, "Password: ", credentials.password)
                    Logger.log.log(Level.WARNING, "userName: ", credentials.userName)
                    Logger.log.log(Level.WARNING, "authState: ", credentials.authState)

                    if (credentials.authState == null) {
                        credentials.passwordNeedsUpdate = true
                        accountSettings.credentials(credentials)