diff options
| author | Sumit Arora | 2014-05-14 02:16:00 +1000 | 
|---|---|---|
| committer | Sumit Arora | 2014-05-14 02:16:00 +1000 | 
| commit | 377a4931b52666040d819d3c21d5eb88da8adcfa (patch) | |
| tree | 6b5d9d3ec55ae07cbb832b7829b438b2562a72d0 /auth | |
| parent | 79cbfc2986f4c8152de187ae2be207829d08077f (diff) | |
| download | gdrive-377a4931b52666040d819d3c21d5eb88da8adcfa.tar.bz2 | |
Add an option to not prompt the user for oauth authentication
interactively. This is a no-op for the cli, where the option
defaults to true.
Use Case: In automation apps/scripts where gdrive/gdrive is used
as a third party module (as opposed to a cli app). It is desirable
to not be prompted interactively. Instead return the error and let
the calling code handle it.
Diffstat (limited to 'auth')
| -rw-r--r-- | auth/auth.go | 2 | 
1 files changed, 1 insertions, 1 deletions
| diff --git a/auth/auth.go b/auth/auth.go index ed65920..22267da 100644 --- a/auth/auth.go +++ b/auth/auth.go @@ -35,7 +35,7 @@ func hasValidToken(cacheFile oauth.CacheFile, transport *oauth.Transport) bool {  	return true  } -func GetOauth2Client(clientId, clientSecret, cachePath string) (*http.Client, error) { +func GetOauth2Client(clientId, clientSecret, cachePath string, promptUser bool) (*http.Client, error) {  	cacheFile := oauth.CacheFile(cachePath)  	config := &oauth.Config{ | 
