Vivek Modi
commainMain
interface ApplicationToken { val accessToken: String val refreshToken: String }
iosMain
lateinit var tokenProvider: ApplicationToken
actual fun httpClient(config: HttpClientConfig<*>.() -> Unit) = HttpClient(Darwin) { config(this) engine { configureRequest { setAllowsCellularAccess(true) } } install(Auth) { bearer { loadTokens { BearerTokens(tokenProvider.accessToken, "") } } } }
tokenProvider
class getToken : ApplicationToken { let accessToken: String = "" let refreshToken: String = "" }
russhwolf
PlatformKt.tokenProvider
A modern programming language that makes developers happier.