0

I'm trying to add AUTH Token to Retrofit I'm saving token on preferences Datastore but when I trying to retrieve it show null

enter image description here

1 Answers1

0

My code like this and its working.

    private fun getHeaderInterceptor():Interceptor{
    return Interceptor { chain ->
        val request =
            chain.request().newBuilder()
                .header("Cookie", cookie!!)
                .build()
        chain.proceed(request)
    }
}

Full code: https://gist.github.com/Cr3bain/adf61caaa9da3291e1739c9bf0f334d8

Crebain
  • 180
  • 1
  • 8