refreshTokenIn

fun refreshTokenIn(scope: CoroutineScope, refreshToken: suspend (Token) -> Token, releaseToken: suspend (Token) -> Unit, onFailure: suspend (t: Throwable) -> Unit): Job

A helper function to refresh and release the Token found in TokenStore.

Note that this function is not intended for consumers to use directly.

Parameters

scope

a CoroutineScope to launch the refresh process in

refreshToken

a function that refreshes the Token

releaseToken

a function that releases the Token

onFailure

a callback to notify callers about failures