aboutsummaryrefslogtreecommitdiff
path: root/src/server/apis/google
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/apis/google')
-rw-r--r--src/server/apis/google/GoogleApiServerUtils.ts10
-rw-r--r--src/server/apis/google/google_project_credentials.json2
2 files changed, 9 insertions, 3 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',
diff --git a/src/server/apis/google/google_project_credentials.json b/src/server/apis/google/google_project_credentials.json
index 738e13647..010f9a626 100644
--- a/src/server/apis/google/google_project_credentials.json
+++ b/src/server/apis/google/google_project_credentials.json
@@ -6,6 +6,6 @@
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_secret": "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",
- "redirect_uris": ["urn:ietf:wg:oauth:2.0:oob", "http://localhost"]
+ "redirect_uris": ["http://localhost:1050/refreshGoogle"]
}
} \ No newline at end of file