fix: block user-initiated org creation (#276)
This commit is contained in:
parent
0652f3a8a6
commit
17c6c8f60b
@ -17,7 +17,14 @@ export function createBaseAuthConfig() {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
organization(),
|
// Block user-initiated org creation: each org is its own Autumn customer
|
||||||
|
// with its own onboarding-plan credit grant, so an authenticated user
|
||||||
|
// hitting POST /api/auth/organization/create could mint unlimited fresh
|
||||||
|
// grants. The app gives every user exactly one workspace, created
|
||||||
|
// server-side at signup via `auth.api.createOrganization({ body: { userId }})`
|
||||||
|
// — that's a "system action" (no session + userId in body) which better-auth
|
||||||
|
// exempts from this flag, so the bootstrap keeps working.
|
||||||
|
organization({ allowUserToCreateOrganization: false }),
|
||||||
genericOAuth({
|
genericOAuth({
|
||||||
config: [
|
config: [
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user