From 08feca745519f48c23f94d4799d511928507e863 Mon Sep 17 00:00:00 2001 From: Kaung Khant Soe Date: Fri, 6 Jan 2023 14:19:26 +0700 Subject: [PATCH] [#228] Remove redundant line and refactor code format --- .../co/nimblehq/template/xml/di/modules/RetrofitModule.kt | 4 +--- .../service/authenticator/ApplicationRequestAuthenticator.kt | 5 ++--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/template-xml/app/src/main/java/co/nimblehq/template/xml/di/modules/RetrofitModule.kt b/template-xml/app/src/main/java/co/nimblehq/template/xml/di/modules/RetrofitModule.kt index f8bab3a10..0713b58b9 100644 --- a/template-xml/app/src/main/java/co/nimblehq/template/xml/di/modules/RetrofitModule.kt +++ b/template-xml/app/src/main/java/co/nimblehq/template/xml/di/modules/RetrofitModule.kt @@ -40,7 +40,6 @@ class RetrofitModule { fun provideApiService(retrofit: Retrofit): ApiService = ApiServiceProvider.getApiService(retrofit) - @Authenticate @Provides fun provideAuthRetrofit( @@ -54,6 +53,5 @@ class RetrofitModule { @Provides fun provideAuthService( @Authenticate retrofit: Retrofit - ): AuthService = - ApiServiceProvider.getAuthService(retrofit) + ): AuthService = ApiServiceProvider.getAuthService(retrofit) } diff --git a/template-xml/data/src/main/java/co/nimblehq/template/xml/data/service/authenticator/ApplicationRequestAuthenticator.kt b/template-xml/data/src/main/java/co/nimblehq/template/xml/data/service/authenticator/ApplicationRequestAuthenticator.kt index c2ee59bb7..9e8494b20 100644 --- a/template-xml/data/src/main/java/co/nimblehq/template/xml/data/service/authenticator/ApplicationRequestAuthenticator.kt +++ b/template-xml/data/src/main/java/co/nimblehq/template/xml/data/service/authenticator/ApplicationRequestAuthenticator.kt @@ -10,6 +10,8 @@ import kotlinx.coroutines.flow.last import okhttp3.* const val REQUEST_HEADER_AUTHORIZATION = "Authorization" +const val HEADER_AUTHENTICATION_SKIPPING_ERROR_TYPE = "Authentication-Skipping-ErrorType" +private const val MAX_ATTEMPTS = 3 class ApplicationRequestAuthenticator( private val tokenRefresher: TokenRefresher, @@ -88,6 +90,3 @@ class ApplicationRequestAuthenticator( return false } } - -const val HEADER_AUTHENTICATION_SKIPPING_ERROR_TYPE = "Authentication-Skipping-ErrorType" -private const val MAX_ATTEMPTS = 3