aboutsummaryrefslogtreecommitdiff
path: root/src/server/ApiManagers/GeneralGoogleManager.ts
diff options
context:
space:
mode:
authorSkitty1238 <157652284+Skitty1238@users.noreply.github.com>2025-06-04 22:33:19 -0400
committerSkitty1238 <157652284+Skitty1238@users.noreply.github.com>2025-06-04 22:33:19 -0400
commitc86bf5cc03d6fa59fbc11118d4e743d4c3064697 (patch)
tree2e23a7090046a9f83e7b55feb5b19804348ac1e3 /src/server/ApiManagers/GeneralGoogleManager.ts
parent745784b36e0f6fd2557ffe0d32cf11051627b148 (diff)
parent55d1653c0d6c19bddefb9e57753374d43d8f23dc (diff)
Merge branch 'task_nodes_aarav' of https://github.com/brown-dash/Dash-Web into task_nodes_aarav
Diffstat (limited to 'src/server/ApiManagers/GeneralGoogleManager.ts')
-rw-r--r--src/server/ApiManagers/GeneralGoogleManager.ts9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/server/ApiManagers/GeneralGoogleManager.ts b/src/server/ApiManagers/GeneralGoogleManager.ts
index 7581eec13..4f0b8c02b 100644
--- a/src/server/ApiManagers/GeneralGoogleManager.ts
+++ b/src/server/ApiManagers/GeneralGoogleManager.ts
@@ -17,10 +17,9 @@ export default class GeneralGoogleManager extends ApiManager {
method: Method.GET,
subscription: '/readGoogleAccessToken',
secureHandler: async ({ user, res }) => {
- const { credentials } = await GoogleApiServerUtils.retrieveCredentials(user);
+ const { credentials } = await GoogleApiServerUtils.retrieveCredentials(user.id);
if (!credentials?.access_token) {
- const url = GoogleApiServerUtils.generateAuthenticationUrl();
- return res.send(url);
+ return res.send(GoogleApiServerUtils.generateAuthenticationUrl());
}
return res.send(credentials);
},
@@ -49,7 +48,7 @@ export default class GeneralGoogleManager extends ApiManager {
secureHandler: async ({ req, res, user }) => {
const sector: GoogleApiServerUtils.Service = req.params.sector as GoogleApiServerUtils.Service;
const action: GoogleApiServerUtils.Action = req.params.action as GoogleApiServerUtils.Action;
- const endpoint = await GoogleApiServerUtils.GetEndpoint(GoogleApiServerUtils.Service[sector], user);
+ const endpoint = await GoogleApiServerUtils.GetEndpoint(GoogleApiServerUtils.Service[sector], user.id);
const handler = EndpointHandlerMap.get(action);
if (endpoint && handler) {
try {
@@ -71,7 +70,7 @@ export default class GeneralGoogleManager extends ApiManager {
subscription: new RouteSubscriber('googleTasks').add('create'),
secureHandler: async ({ req, res, user }) => {
try {
- const auth = await GoogleApiServerUtils.retrieveOAuthClient(user);
+ const auth = await GoogleApiServerUtils.retrieveOAuthClient(user.id);
if (!auth) {
return res.status(401).send('Google credentials missing or invalid.');