feat: remove default personal orgs from custom sso (#2741)

This commit is contained in:
David Nguyen
2026-05-05 14:50:07 +10:00
committed by GitHub
parent 6a6ef8d2ad
commit f10d3284ba
9 changed files with 67 additions and 6 deletions
+16 -2
View File
@@ -60,13 +60,27 @@ export const createUser = async ({ name, email, password, signature }: CreateUse
return user;
};
export type OnCreateUserHookOptions = {
/**
* When true, do not create a "Personal Organisation" for the new user.
* Used by the Organisation SSO signup path, where the user is intended
* to operate inside the SSO organisation rather than a personal space.
*
* Defaults to false — preserves the historical behaviour of creating a
* personal organisation for every new user.
*/
skipPersonalOrganisation?: boolean;
};
/**
* Should be run after a user is created, example during email password signup or google sign in.
*
* @returns User
*/
export const onCreateUserHook = async (user: User) => {
await createPersonalOrganisation({ userId: user.id });
export const onCreateUserHook = async (user: User, options: OnCreateUserHookOptions = {}) => {
if (!options.skipPersonalOrganisation) {
await createPersonalOrganisation({ userId: user.id });
}
return user;
};