Skip to content

Commit

Permalink
fix #2359: job to build with apk
Browse files Browse the repository at this point in the history
  • Loading branch information
PratyushSingh07 authored and therajanmaurya committed Oct 13, 2023
1 parent 7267667 commit 5eee0ce
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,21 @@ import okhttp3.Request.Builder
import okhttp3.Response
import java.io.IOException
import kotlin.jvm.Throws
import org.mifos.mobile.api.local.PreferencesHelper

/**
* @author Vishwajeet
* @since 21/06/16
*/
class SelfServiceInterceptor(private val tenant: String?, private val authToken: String?) :
class SelfServiceInterceptor(private val preferencesHelper: PreferencesHelper) :
Interceptor {
@Throws(IOException::class)
override fun intercept(chain: Interceptor.Chain): Response {
val chainRequest: Request = chain.request()
val builder: Builder = chainRequest.newBuilder()
.header(HEADER_TENANT, tenant)
if (!TextUtils.isEmpty(authToken)) {
builder.header(HEADER_AUTH, authToken)
.header(HEADER_TENANT, preferencesHelper.tenant)
if (!TextUtils.isEmpty(preferencesHelper.token)) {
builder.header(HEADER_AUTH, preferencesHelper.token)
}
val request: Request = builder.build()
return chain.proceed(request)
Expand Down

0 comments on commit 5eee0ce

Please sign in to comment.