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}`;
|
const namespaced = (s: string) => `${NAMESPACE}.${s}`;
|
||||||
|
|
||||||
export const viewerOrganizationsRouter = router({
|
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"));
|
const handler = await importHandler(namespaced("create"), () => import("./create.handler"));
|
||||||
return handler(opts);
|
return handler(opts);
|
||||||
}),
|
}),
|
||||||
|
|
|
@ -121,7 +121,7 @@ export const createHandler = async ({ input, ctx }: CreateOptions) => {
|
||||||
metadata: {
|
metadata: {
|
||||||
...(IS_TEAM_BILLING_ENABLED ? { requestedSlug: slug } : {}),
|
...(IS_TEAM_BILLING_ENABLED ? { requestedSlug: slug } : {}),
|
||||||
isOrganization: true,
|
isOrganization: true,
|
||||||
isOrganizationVerified: false,
|
isOrganizationVerified: true,
|
||||||
isOrganizationConfigured,
|
isOrganizationConfigured,
|
||||||
orgAutoAcceptEmail: emailDomain,
|
orgAutoAcceptEmail: emailDomain,
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue
Block a user