aboutsummaryrefslogtreecommitdiff
path: root/src/server/apis/google/GoogleApiServerUtils.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/apis/google/GoogleApiServerUtils.ts')
-rw-r--r--src/server/apis/google/GoogleApiServerUtils.ts13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/server/apis/google/GoogleApiServerUtils.ts b/src/server/apis/google/GoogleApiServerUtils.ts
index 2f7ef473c..45c661730 100644
--- a/src/server/apis/google/GoogleApiServerUtils.ts
+++ b/src/server/apis/google/GoogleApiServerUtils.ts
@@ -14,6 +14,7 @@ import { DashUserModel } from '../../authentication/DashUserModel';
* This is the somewhat overkill list of what Dash requests
* from the user.
*/
+// 'https://www.googleapis.com/auth/tasks', 'openid', 'profile'
const scope = ['tasks', 'documents.readonly', 'documents', 'presentations', 'presentations.readonly', 'drive', 'drive.file', 'photoslibrary', 'photoslibrary.appendonly', 'photoslibrary.sharing', 'userinfo.profile'].map(
relative => `https://www.googleapis.com/auth/${relative}`
);
@@ -184,17 +185,7 @@ export namespace GoogleApiServerUtils {
* @returns the newly generated url to the authentication landing page
*/
export function generateAuthenticationUrl(): string {
- const oauth2Client = new google.auth.OAuth2(
- '740987818053-dtflji3hfkn5r9t8ad6jb8740pls8moh.apps.googleusercontent.com',
- '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',
- 'http://localhost:1050/refreshGoogle' // Ensure this matches the redirect URI in Google Cloud Console
- );
-
- return oauth2Client.generateAuthUrl({
- access_type: 'offline',
- scope: ['https://www.googleapis.com/auth/tasks', 'openid', 'profile'],
- prompt: 'consent', // This ensures we get a refresh token
- });
+ return worker.generateAuthUrl({ scope, access_type: 'offline', prompt: 'consent' });
}
/**