aboutsummaryrefslogtreecommitdiff
path: root/src/server/apis/google/GoogleApiServerUtils.ts
diff options
context:
space:
mode:
authorSkitty1238 <157652284+Skitty1238@users.noreply.github.com>2025-06-04 18:28:35 -0400
committerSkitty1238 <157652284+Skitty1238@users.noreply.github.com>2025-06-04 18:28:35 -0400
commit09be9002b5aa8f5ad7c602bcef6b53bbe0398cd3 (patch)
tree730acef57ae76d8698c68acb641fce3167d9c941 /src/server/apis/google/GoogleApiServerUtils.ts
parent645df1d00f953524c6da22103d26c38ae4331cd6 (diff)
fixed google authentication + linking and task creation via GT button
Diffstat (limited to 'src/server/apis/google/GoogleApiServerUtils.ts')
-rw-r--r--src/server/apis/google/GoogleApiServerUtils.ts10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/server/apis/google/GoogleApiServerUtils.ts b/src/server/apis/google/GoogleApiServerUtils.ts
index 75f904331..56bc79119 100644
--- a/src/server/apis/google/GoogleApiServerUtils.ts
+++ b/src/server/apis/google/GoogleApiServerUtils.ts
@@ -59,6 +59,7 @@ export namespace GoogleApiServerUtils {
*/
export function processProjectCredentials(): void {
const { client_secret: clientSecret, client_id: clientId, redirect_uris: redirectUris } = GoogleCredentialsLoader.ProjectCredentials;
+ console.log('Loaded Google redirect URIs:', redirectUris);
// initialize the global authorization client
oAuthOptions = {
clientId,
@@ -191,7 +192,12 @@ export namespace GoogleApiServerUtils {
return oauth2Client.generateAuthUrl({
access_type: 'offline',
- scope: ['https://www.googleapis.com/auth/tasks'],
+ scope: [
+ 'https://www.googleapis.com/auth/tasks',
+ 'openid',
+ 'profile'
+ ],
+ prompt: 'consent', // This ensures we get a refresh token
});
}
@@ -306,7 +312,7 @@ export namespace GoogleApiServerUtils {
const headerParameters = { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } };
const { client_id, client_secret } = GoogleCredentialsLoader.ProjectCredentials;
const params = new URLSearchParams({
- refresh_token: credentials.refresh_token!, // AARAV use user.googleToken
+ refresh_token: credentials.refresh_token!, // AARAV use user.googleToken
client_id,
client_secret,
grant_type: 'refresh_token',