Skip to content

Commit 8d06879

Browse files
committed
fix: add priority selection to tenants
1 parent 6dea367 commit 8d06879

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

src/SupertokensSyncService.ts

+14
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,20 @@ export class SupertokensSyncService {
7979
};
8080
}
8181

82+
controlTenants({
83+
devTenants,
84+
prodTenants,
85+
}: {
86+
devTenants: string[];
87+
prodTenants: string[];
88+
}) {
89+
if (this.config.priority === "dev") {
90+
return devTenants;
91+
} else {
92+
return prodTenants;
93+
}
94+
}
95+
8296
controlRolesAndPermissions({
8397
comparisonResult,
8498
rolesA,

src/index.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,14 @@ async function main() {
4343
rolesB: rolesWithPermissionsProd,
4444
});
4545

46+
const targetTenants = service.controlTenants({
47+
devTenants: currentDevTenants,
48+
prodTenants: currentProdTenants,
49+
});
50+
4651
await service.generateAuthConfig({
4752
rolesWithPermissions: targetRolesWithPermissions,
48-
tenants: currentProdTenants,
53+
tenants: targetTenants,
4954
});
5055
}
5156

0 commit comments

Comments
 (0)