Skip to content

Commit 71064af

Browse files
author
Clément Denis
authored
Update example for Google OAuth2 offline access
1 parent dee0ea4 commit 71064af

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,13 @@ function getDriveService() {
124124

125125
// Sets the login hint, which will prevent the account chooser screen
126126
// from being shown to users logged in with multiple accounts.
127+
// Prefer Session.getEffectiveUser().getEmail() if used in add-ons.
127128
.setParam('login_hint', Session.getActiveUser().getEmail())
128129

129130
// Requests offline access.
130131
.setParam('access_type', 'offline')
131-
132-
// Forces the approval prompt every time. This is useful for testing,
133-
// but not desirable in a production application.
134-
.setParam('approval_prompt', 'force');
132+
// This param is required to ensure a refresh token is always returned.
133+
.setParam('prompt', 'consent');
135134
}
136135
```
137136

0 commit comments

Comments
 (0)