How to wait result of suspend function?
I need to add freshCsrf string to each request into form body. Uses OkHttpClient with AuthInterceptor. The problem is how to send request inside interceptor in order to get the freshCsrf string?
In code below occurs error
Suspend function 'getAuth' should be called only from a coroutine or another suspend function
class AuthInterceptor(val authApi: IAuthService) : Interceptor {
override fun intercept(chain: Interceptor.Chain): Response {
var request = chain.request()...