Skip to content

Instantly share code, notes, and snippets.

View anhoang241998's full-sized avatar
🏢
Android Developer

Nguyễn Hoàng Ân anhoang241998

🏢
Android Developer
View GitHub Profile
@anhoang241998
anhoang241998 / RequestInterceptor.kt
Last active March 3, 2022 05:09
Generate a new token by log in again.
import com.greenvity.llp.newapp.api.auth.AuthRetrofitInstance
import com.greenvity.llp.newapp.models.auth.login.LoginRequest
import com.greenvity.llp.newapp.utils.shared_pref.AppPreferences
import kotlinx.coroutines.runBlocking
import kotlinx.coroutines.sync.Mutex
import kotlinx.coroutines.sync.withLock
import okhttp3.Interceptor
import okhttp3.Request
import okhttp3.Response
import java.net.HttpURLConnection.*