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 Chauhan 2023-12-21 17:40:46 +05:30 committed by GitHub
parent 9fbb0808be
commit dea873fef1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -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);
}),

View File

@ -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,
},