π¨ The ultimate agentic social media scheduling tool π€
TypeScript nextjsopen-sourceopen-source-social-media-scheduling-toolosspostiz-cloudpostiz-hostedredisscheduling-toolsocial-media-scheduling-tooltypescript
feat: generate url
Nevo David34243312ad4f
diff --git a/apps/backend/src/api/routes/enterprise.controller.ts b/apps/backend/src/api/routes/enterprise.controller.tsindex ac3780afa..6be0fc7c2 100644--- a/apps/backend/src/api/routes/enterprise.controller.ts+++ b/apps/backend/src/api/routes/enterprise.controller.ts@@ -46,6 +46,7 @@ export class EnterpriseController {apiKey: string;refreshId?: string;provider: string;+ webhookUrl: string;};if (!load || !load.redirectUrl || !load.apiKey || !load.provider) {@@ -77,6 +78,7 @@ export class EnterpriseController {await ioRedis.set(`refresh:${state}`, load.refreshId, 'EX', 3600);}+ await ioRedis.set(`webhookUrl:${state}`, load.webhookUrl, 'EX', 3600);await ioRedis.set(`redirect:${state}`, load.redirectUrl, 'EX', 3600);await ioRedis.set(`organization:${state}`, org.id, 'EX', 3600);await ioRedis.set(`login:${state}`, codeVerifier, 'EX', 3600);diff --git a/apps/backend/src/api/routes/no.auth.integrations.controller.ts b/apps/backend/src/api/routes/no.auth.integrations.controller.tsindex 9b51c81ed..832505ba2 100644--- a/apps/backend/src/api/routes/no.auth.integrations.controller.ts+++ b/apps/backend/src/api/routes/no.auth.integrations.controller.ts@@ -262,10 +262,33 @@ export class NoAuthIntegrationsController {}}+ const webhookUrl = await ioRedis.get(`webhookUrl:${body.state}`);+ if (webhookUrl) {+ try {+ await fetch(webhookUrl, {+ method: 'POST',+ headers: { 'Content-Type': 'application/json' },+ body: JSON.stringify({+ params: AuthService.signJWT({+ apiKey: org.apiKey,+ }),+ }),+ });+ } catch (err) {}++ await ioRedis.del(`webhookUrl:${body.state}`);+ }++ const returnURL = await ioRedis.get(`redirect:${body.state}`);+ if (returnURL) {+ await ioRedis.del(`redirect:${body.state}`);+ }+return {...createUpdate,onboarding: onboarding === 'true',pages,+ ...(returnURL ? { returnURL } : {}),};}