feat: Restrict organization creation to admins and then automatically verify all organizations (#12787)

Co-authored-by: Hariom Balhara <hariombalhara@gmail.com>
This commit is contained in:
Somay ChauhanandHariom Balhara authored and GitHub committed 2023-12-21 12:10:46 +00:00
1 parent 9fbb0808be
commit dea873fef1
2 files changed
+2 -2

No files matched your search

@@ -28,7 +28,7 @@ const NAMESPACE = "organizations";
const namespaced = (s: string) => `${NAMESPACE}.${s}`;
export const viewerOrganizationsRouter = router({
create: authedProcedure.input(ZCreateInputSchema).mutation(async (opts) => {
create: authedAdminProcedure.input(ZCreateInputSchema).mutation(async (opts) => {
const handler = await importHandler(namespaced("create"), () => import("./create.handler"));
return handler(opts);
}),
@@ -121,7 +121,7 @@ export const createHandler = async ({ input, ctx }: CreateOptions) => {
metadata: {
...(IS_TEAM_BILLING_ENABLED ? { requestedSlug: slug } : {}),
isOrganization: true,
isOrganizationVerified: false,
isOrganizationVerified: true,
isOrganizationConfigured,
orgAutoAcceptEmail: emailDomain,
},