chore: update seed.ts (#25316)
* chore: update seed.ts * Revert "chore: update seed.ts" This reverts commit 2bd0c5a6dc57142632f8fbd267aa6b5eba6d1cea. * use env vars instead
This commit is contained in:
+18
-14
@@ -8,7 +8,7 @@ import dayjs from "@calcom/dayjs";
|
||||
import { getOrgFullOrigin } from "@calcom/ee/organizations/lib/orgDomains";
|
||||
import { hashPassword } from "@calcom/lib/auth/hashPassword";
|
||||
import { DEFAULT_SCHEDULE, getAvailabilityFromSchedule } from "@calcom/lib/availability";
|
||||
import prisma from "@calcom/prisma";
|
||||
import { prisma } from "@calcom/prisma";
|
||||
import type { Membership, Team, User, UserPermissionRole } from "@calcom/prisma/client";
|
||||
import { Prisma } from "@calcom/prisma/client";
|
||||
import { BookingStatus, MembershipRole, RedirectType, SchedulingType } from "@calcom/prisma/enums";
|
||||
@@ -184,18 +184,22 @@ async function createPlatformAndSetupUser({
|
||||
},
|
||||
});
|
||||
|
||||
await prisma.platformOAuthClient.create({
|
||||
data: {
|
||||
name: "Acme",
|
||||
redirectUris: ["http://localhost:4321"],
|
||||
permissions: 1023,
|
||||
areEmailsEnabled: true,
|
||||
organizationId: team.id,
|
||||
id: "clxyyy21o0003sbk7yw5z6tzg",
|
||||
secret:
|
||||
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiQWNtZSAiLCJwZXJtaXNzaW9ucyI6MTAyMywicmVkaXJlY3RVcmlzIjpbImh0dHA6Ly9sb2NhbGhvc3Q6NDMyMSJdLCJib29raW5nUmVkaXJlY3RVcmkiOiIiLCJib29raW5nQ2FuY2VsUmVkaXJlY3RVcmkiOiIiLCJib29raW5nUmVzY2hlZHVsZVJlZGlyZWN0VXJpIjoiIiwiYXJlRW1haWxzRW5hYmxlZCI6dHJ1ZSwiaWF0IjoxNzE5NTk1ODA4fQ.L5_jSS14fcKLCD_9_DAOgtGd6lUSZlU5CEpCPaPt41I",
|
||||
},
|
||||
});
|
||||
const clientId = process.env.SEED_PLATFORM_OAUTH_CLIENT_ID;
|
||||
const secret = process.env.SEED_PLATFORM_OAUTH_CLIENT_SECRET;
|
||||
|
||||
if (clientId && secret) {
|
||||
await prisma.platformOAuthClient.create({
|
||||
data: {
|
||||
name: "Acme",
|
||||
redirectUris: ["http://localhost:4321"],
|
||||
permissions: 1023,
|
||||
areEmailsEnabled: true,
|
||||
organizationId: team.id,
|
||||
id: clientId,
|
||||
secret,
|
||||
},
|
||||
});
|
||||
}
|
||||
console.log(`\t👤 Added '${teamInput.name}' membership for '${username}' with role '${membershipRole}'`);
|
||||
}
|
||||
}
|
||||
@@ -1535,7 +1539,7 @@ async function main() {
|
||||
|
||||
async function runSeed() {
|
||||
await prisma.$connect();
|
||||
|
||||
|
||||
await mainAppStore();
|
||||
await main();
|
||||
await mainHugeEventTypesSeed();
|
||||
|
||||
Reference in New Issue
Block a user