colintheshots
08/11/2021, 2:40 PMAleksei Tirman [JB]
08/11/2021, 3:48 PMcolintheshots
08/11/2021, 4:23 PMinstall(Auth) {
bearer {
loadTokens {
withContext(backgroundDispatcher) {
val code = client.get(URL_REQUEST_GRANT)
val r = <http://client.post|client.post>(urlRequestAccessToken(code.code))
BearerTokens(accessToken = r.accessToken, refreshToken = r.refreshToken)
}
}
//...
However, that only provides an unauthenticated guest token. I then need UI in the app to accept either an email/pw or social token in order to login and generate an authenticated token. I could potentially generate a new HttpClient
for authenticated requests, but there's probably a better way. Ultimately, I'd see if I have an authenticated token in storage before deciding if I should make an authenticated request or if I should say, return to the login screen.Aleksei Tirman [JB]
08/11/2021, 5:44 PMcolintheshots
08/11/2021, 5:49 PMAleksei Tirman [JB]
08/11/2021, 6:35 PMtokensHolder
property since it's private.colintheshots
08/11/2021, 7:42 PM