We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f84e8ad commit 238952fCopy full SHA for 238952f
1 file changed
packages/server/api/src/app/authentication/new-user/organization-assignment.ts
@@ -32,7 +32,16 @@ export async function assignDefaultOrganization(user: User): Promise<void> {
32
});
33
34
const updatedUser = await userService.getOneOrFail({ id: user.id });
35
- const project = await projectService.getUserProjectOrThrow(updatedUser.id);
+ 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
+ }
45
46
await addUserToDefaultWorkspace({
47
email: user.email,
0 commit comments