Skip to content

Instantly share code, notes, and snippets.

View t0in4's full-sized avatar
😇
experienced in kweb

Михайлов Айхаал Владимирович t0in4

😇
experienced in kweb
  • АНО КУЛЛУРУС
View GitHub Profile
@EmmanuelGuther
EmmanuelGuther / RetrofitGetAPIWithAuth.kt
Last active October 11, 2024 10:11
Get rest api with Auth - token and using okhttp Authenticator to manage the refresh token
object RetrofitGetAPIWithAuth {
private val BASE_URL = BuildConfig.API_BASE
private var retrofit: Retrofit? = null
private val tokenLoginModel: TokenLoginModel? = obtainTokenLoginModel()
private val accessToken = tokenLoginModel?.access_token
class HeaderInterceptor : Interceptor {
@Throws(IOException::class)
override fun intercept(chain: Interceptor.Chain): Response {
var request = chain.request()