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:
parent
9fbb0808be
commit
dea873fef1
|
@ -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,
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue
Block a user