Calogero
01/02/2024, 3:30 PMclient.plugin(Auth).providers.filterIsInstance<BearerAuthProvider>().first().clearToken()
where client is an instance of HttpClient.
The property providers doesn't exist anymore.
The code above clears the token holder instance inside the BearerAuthProvider. I'm running this line of code when the user is logging out.
I'm using Ktor 2.3.7
What would be the equivalent code in Ktor 3.0.0?
Thanksp-schneider
01/02/2024, 3:55 PMimport io.ktor.client.plugins.auth.authProviders
client.authProviders.filterIsInstance<BearerAuthProvider>().first().clearToken()
Haven't tried it myself, but at least it would compile.Calogero
01/02/2024, 4:50 PMAleksei Tirman [JB]
01/03/2024, 8:00 AMclient.authProvider<BearerAuthProvider>()?.clearToken()