Skip to content

Commit 47f9962

Browse files
author
Eric Koleda
authored
Merge pull request googleworkspace#210 from AODocs/offline_access_update
Update example for Google OAuth2 offline access
2 parents dee0ea4 + 3530650 commit 47f9962

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,14 @@ 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-
.setParam('login_hint', Session.getActiveUser().getEmail())
127+
.setParam('login_hint', Session.getEffectiveUser().getEmail())
128128

129129
// Requests offline access.
130130
.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');
131+
132+
// Consent prompt is required to ensure a refresh token is always
133+
// returned when requesting offline access.
134+
.setParam('prompt', 'consent');
135135
}
136136
```
137137

0 commit comments

Comments
 (0)