title: Using coroutines in retrofit authenticator
body: <p>I'm trying to implement JWT token authentication and refresh token in retrofit using coroutines. The tokens are stored in a Room database. How should I implement the await call?</p>
  
  <p>Currently I'm using runBlocking {...} call to wait for the async local/remote response</p>
  
  <p>Example: </p>
  
  <pre><code>client.addInterceptor {
          val accessToken = runBlocking { tokenRepository.getActiveToken() }?.access_token ?: "-"
          val request = it.request()
              .newBuilder()
              .addHeader("Authorization", "Bearer $accessToken")
              .build()
          return@addInterceptor it.proceed(request)
      }
  </code></pre>
  
  <p>What I'd like to follow is the traditional pattern of:</p>
  
  <pre><code>launch {
      withContext(IO){...}
  }
  </code></pre>
  
  <p>How should I go about it?</p>