MarkEdmondson1234 / googleAuthR

Google API Client Library for R. Easy authentication and help to build Google API R libraries with OAuth2. Shiny compatible.
https://code.markedmondson.me/googleAuthR
Other
175 stars 51 forks source link

Set the token when invoking `gar_gce_auth_default` #226

Closed manuteleco closed 1 year ago

manuteleco commented 1 year ago

Following the same behavior as gar_gce_auth for the sake of consistency and because it looks like it might have been the original intention as well, judging from the function's documentation.

Now the token is not only generated, but also automatically established internally in the library to be used for subsequent API calls.

Before this commit, one would have to write:

token <- gar_gce_auth_default()
gar_auth(token)

while now this is enough:

gar_gce_auth_default()

which maintains symmetry to how one would authorize using GCE credentials:

gar_gce_auth()
MarkEdmondson1234 commented 1 year ago

Ahh this explains some weird behavior I saw thank you :)