Running trackdown_auth(path = json_path) ignores the JSON file at json_path.
To reproduce:
- Authenticate with an app that doesn't use a given JSON.
- Run
json_path <- "path/to/test.json"
trackdown::trackdown_auth(path = json_path) # This doesn't work
- The web page that opens refers to the app from stage 1, not the app connected to the JSON file.
As far as I can tell, this is due to the fact that path hasn't been processed in any way by the time the following line is run in trackdown_auth:
app = trackdown_oauth_client() %||% trackdown_client()
It also looks like path is silently ignored by gargle::token_fetch() within trackdown_auth since the following doesn't raise an error:
trackdown::trackdown_auth(path = random_undefined_variable)
I worked around this issue by running trackdown_auth_configure(path = json_path) before running trackdown_auth. Would it make sense to do that at the top of trackdown_auth if path is specified? E.g., add
if (!is.null(path)) {
trackdown_auth_configure(path = path)
}
Running
trackdown_auth(path = json_path)ignores the JSON file atjson_path.To reproduce:
As far as I can tell, this is due to the fact that
pathhasn't been processed in any way by the time the following line is run intrackdown_auth:It also looks like
pathis silently ignored bygargle::token_fetch()withintrackdown_authsince the following doesn't raise an error:I worked around this issue by running
trackdown_auth_configure(path = json_path)before runningtrackdown_auth. Would it make sense to do that at the top oftrackdown_authifpathis specified? E.g., add