@@ -8,7 +8,7 @@ import dayjs from "@calcom/dayjs";
88import { getOrgFullOrigin } from "@calcom/ee/organizations/lib/orgDomains" ;
99import { hashPassword } from "@calcom/lib/auth/hashPassword" ;
1010import { DEFAULT_SCHEDULE , getAvailabilityFromSchedule } from "@calcom/lib/availability" ;
11- import prisma from "@calcom/prisma" ;
11+ import { prisma } from "@calcom/prisma" ;
1212import type { Membership , Team , User , UserPermissionRole } from "@calcom/prisma/client" ;
1313import { Prisma } from "@calcom/prisma/client" ;
1414import { BookingStatus , MembershipRole , RedirectType , SchedulingType } from "@calcom/prisma/enums" ;
@@ -184,18 +184,22 @@ async function createPlatformAndSetupUser({
184184 } ,
185185 } ) ;
186186
187- await prisma . platformOAuthClient . create ( {
188- data : {
189- name : "Acme" ,
190- redirectUris : [ "http://localhost:4321" ] ,
191- permissions : 1023 ,
192- areEmailsEnabled : true ,
193- organizationId : team . id ,
194- id : "clxyyy21o0003sbk7yw5z6tzg" ,
195- secret :
196- "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiQWNtZSAiLCJwZXJtaXNzaW9ucyI6MTAyMywicmVkaXJlY3RVcmlzIjpbImh0dHA6Ly9sb2NhbGhvc3Q6NDMyMSJdLCJib29raW5nUmVkaXJlY3RVcmkiOiIiLCJib29raW5nQ2FuY2VsUmVkaXJlY3RVcmkiOiIiLCJib29raW5nUmVzY2hlZHVsZVJlZGlyZWN0VXJpIjoiIiwiYXJlRW1haWxzRW5hYmxlZCI6dHJ1ZSwiaWF0IjoxNzE5NTk1ODA4fQ.L5_jSS14fcKLCD_9_DAOgtGd6lUSZlU5CEpCPaPt41I" ,
197- } ,
198- } ) ;
187+ const clientId = process . env . SEED_PLATFORM_OAUTH_CLIENT_ID ;
188+ const secret = process . env . SEED_PLATFORM_OAUTH_CLIENT_SECRET ;
189+
190+ if ( clientId && secret ) {
191+ await prisma . platformOAuthClient . create ( {
192+ data : {
193+ name : "Acme" ,
194+ redirectUris : [ "http://localhost:4321" ] ,
195+ permissions : 1023 ,
196+ areEmailsEnabled : true ,
197+ organizationId : team . id ,
198+ id : clientId ,
199+ secret,
200+ } ,
201+ } ) ;
202+ }
199203 console . log ( `\t👤 Added '${ teamInput . name } ' membership for '${ username } ' with role '${ membershipRole } '` ) ;
200204 }
201205}
@@ -1535,7 +1539,7 @@ async function main() {
15351539
15361540async function runSeed ( ) {
15371541 await prisma . $connect ( ) ;
1538-
1542+
15391543 await mainAppStore ( ) ;
15401544 await main ( ) ;
15411545 await mainHugeEventTypesSeed ( ) ;
0 commit comments