diff --git a/express/api_routes.js b/express/api_routes.js index 8d909232..abb0acf5 100644 --- a/express/api_routes.js +++ b/express/api_routes.js @@ -35,6 +35,7 @@ function setupProxyRoutes() { let fdkHelper = FdkHelper.getInstance(req.fdkSession.cluster, extension); let platformConfig = await fdkHelper.getPlatformConfigInstance(req.fdkSession.company_id); platformConfig.oauthClient.setToken(req.fdkSession); + await platformConfig.oauthClient.renewAccessToken(); const client = new PlatformClient(platformConfig); req.platformClient = client; req.extension = extension; diff --git a/express/index.js b/express/index.js index a6155f2b..04d728b8 100644 --- a/express/index.js +++ b/express/index.js @@ -27,6 +27,7 @@ function setupFdk(data) { }); let session = await SessionStorage.getSession(sid); platformConfig.oauthClient.setToken(session); + await platformConfig.oauthClient.renewAccessToken(); client = new PlatformClient(platformConfig); } return client; diff --git a/express/routes.js b/express/routes.js index db396089..7db37183 100644 --- a/express/routes.js +++ b/express/routes.js @@ -188,6 +188,7 @@ function setupRoutes(ext) { }); let session = await SessionStorage.getSession(sid); platformConfig.oauthClient.setToken(session); + await platformConfig.oauthClient.renewAccessToken(); const client = new PlatformClient(platformConfig); req.platformClient = client; }