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

gar_auth() check conditions (#184) #185

Closed CorradoLanera closed 4 years ago

CorradoLanera commented 4 years ago

In gar_auth() the second check look for NULL or empty scopes. As highlighted in #184, the second check (ie scopes != "") can be and actually is a vector of length greater than one. This could possibly lead to errors because only the first element would be considered.

This pull request purpose to solve the issue by wrapping that check into an any() call (ie, any(scopes != "")).

A test is also provided to check against this issue, all the other tests passed on my machine (Linux Debian 10, R 4.0.2, googleAuthR 1.3.0)

MarkEdmondson1234 commented 4 years ago

Text book issue and pull request, thanks a lot!