Skip to content

πŸ“¨ The ultimate agentic social media scheduling tool πŸ€–

feat: add organization to auth flow

Nevo Davidad0b0259eb25
diff --git a/libraries/nestjs-libraries/src/database/prisma/oauth/oauth.service.ts b/libraries/nestjs-libraries/src/database/prisma/oauth/oauth.service.ts
index a6a0784f0..610b424ce 100644
--- a/libraries/nestjs-libraries/src/database/prisma/oauth/oauth.service.ts
+++ b/libraries/nestjs-libraries/src/database/prisma/oauth/oauth.service.ts
@@ -138,9 +138,13 @@ export class OAuthService {
const token = 'pos_' + makeId(40);
const encryptedToken = AuthService.fixedEncryption(token);
- await this._oauthRepository.exchangeCodeForToken(auth.id, encryptedToken);
+ const { organizationId } = await this._oauthRepository.exchangeCodeForToken(
+ auth.id,
+ encryptedToken
+ );
return {
+ id: organizationId,
access_token: token,
token_type: 'bearer',
};