I don't think we can just inherit this from Token2.0 because removing a token from the cache is different for Gargle2.0 tokens. This is also not going to come up very often, i.e. is not urgent, but is worth doing.
relevant excerpt from httr::Token2.0:
refresh = function() {
cred <- refresh_oauth2.0(self$endpoint, self$app,
self$credentials, self$params$user_params, self$params$use_basic_auth)
if (is.null(cred)) {
remove_cached_token(self) # <-- this won't actually un-cache a Gargle2.0 token
} else {
self$credentials <- cred
self$cache()
}
self
},
I don't think we can just inherit this from Token2.0 because removing a token from the cache is different for Gargle2.0 tokens. This is also not going to come up very often, i.e. is not urgent, but is worth doing.
relevant excerpt from
httr::Token2.0: