aboutsummaryrefslogtreecommitdiff
path: root/src/server/apis/google/GoogleApiServerUtils.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2025-06-04 21:32:34 -0400
committerbobzel <zzzman@gmail.com>2025-06-04 21:32:34 -0400
commitf7cb0dcebb0514cf38f8a7e635ec9959c196145a (patch)
treee352a223a692d922e9f9780fd069d786f4c3bec1 /src/server/apis/google/GoogleApiServerUtils.ts
parent8d424c8cb4d178d5fb92b6543d63fa409eb6430b (diff)
cleaned up getting client id/secret for google. fixed final message after going through authentication process.
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' });
}
/**