Skip to content

Commit 238952f

Browse files
fix
1 parent f84e8ad commit 238952f

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

packages/server/api/src/app/authentication/new-user/organization-assignment.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,16 @@ export async function assignDefaultOrganization(user: User): Promise<void> {
3232
});
3333

3434
const updatedUser = await userService.getOneOrFail({ id: user.id });
35-
const project = await projectService.getUserProjectOrThrow(updatedUser.id);
35+
const project = await projectService.getOneForUser(updatedUser);
36+
37+
if (isNil(project)) {
38+
throw new ApplicationError({
39+
code: ErrorCode.ENTITY_NOT_FOUND,
40+
params: {
41+
message: 'No project found for user',
42+
},
43+
});
44+
}
3645

3746
await addUserToDefaultWorkspace({
3847
email: user.email,

0 commit comments

Comments
 (0)