@@ -50,8 +50,8 @@ object each time you want to use it. The example below shows how to create a
50
50
service for the Google Drive API.
51
51
52
52
function getDriveService() {
53
- // Create a new service with the given name. The name will be used when
54
- // persisting the authorized token, so ensure it is unique within the
53
+ // Create a new service with the given name. The name will be used when
54
+ // persisting the authorized token, so ensure it is unique within the
55
55
// scope of the property store.
56
56
return OAuth2.createService('drive')
57
57
@@ -66,7 +66,7 @@ service for the Google Drive API.
66
66
// Set the project key of the script using this library.
67
67
.setProjectKey('...')
68
68
69
- // Set the name of the callback function in the script referenced
69
+ // Set the name of the callback function in the script referenced
70
70
// above that should be invoked to complete the OAuth flow.
71
71
.setCallbackFunction('authCallback')
72
72
@@ -78,7 +78,7 @@ service for the Google Drive API.
78
78
79
79
// Below are Google-specific OAuth2 parameters.
80
80
81
- // Sets the login hint, which will prevent the account chooser screen
81
+ // Sets the login hint, which will prevent the account chooser screen
82
82
// from being shown to users logged in with multiple accounts.
83
83
.setParam('login_hint', Session.getActiveUser().getEmail())
84
84
@@ -102,7 +102,7 @@ The URL is generated by the service, using the function `getAuthorizationUrl()`.
102
102
var authorizationUrl = driveService.getAuthorizationUrl();
103
103
var template = HtmlService.createTemplate(
104
104
'<a href="<?= authorizationUrl ?>" target="_blank">Authorize</a>. ' +
105
- 'Refresh the page when authorization complete.');
105
+ 'Reopen the sidebar when the authorization is complete.');
106
106
template.authorizationUrl = authorizationUrl;
107
107
var page = template.evaluate();
108
108
DocumentApp.getUi().showSidebar(page);
@@ -154,25 +154,27 @@ differences in how they implement the standard it may be that some APIs
154
154
aren't compatible. If you find an API that it does't work with, open an issue or
155
155
fix the problem yourself and make a pull request against the source code.
156
156
157
- ## Other features
158
- ####Reseting the Access Token
157
+ ## Other features
158
+
159
+ #### Resetting the Access Token
159
160
160
161
If you have an access token set and need to remove it from the property store
161
- you can remove it with the ` reset() ` function. Before you can call reset you need
162
- to set the property store.
162
+ you can remove it with the ` reset() ` function. Before you can call reset you
163
+ need to set the property store.
163
164
164
165
function clearService(){
165
166
OAuth2.createService('drive')
166
167
.setPropertyStore(PropertiesService.getUserProperties())
167
168
.reset();
168
169
}
169
170
170
- ####Setting the Token Format
171
+ #### Setting the Token Format
171
172
172
173
OAuth services can return a token in two ways: as JSON or an URL encoded
173
- string. You can set which format the token is in with ` setTokenFormat(tokenFormat) ` .
174
- There are two ENUMS to set the mode: ` TOKEN_FORMAT.FORM_URL_ENCODED ` and ` TOKEN_FORMAT.JSON ` .
175
- JSON is set as default if no token format is chosen.
174
+ string. You can set which format the token is in with
175
+ ` setTokenFormat(tokenFormat) ` . There are two ENUMS to set the mode:
176
+ ` TOKEN_FORMAT.FORM_URL_ENCODED ` and ` TOKEN_FORMAT.JSON ` . JSON is set as default
177
+ if no token format is chosen.
176
178
177
179
function gitService() {
178
180
return OAuth2.createService('git')
0 commit comments