fix(auth): prevent workspace creation on signup with password with no authorized user + fix 10982 (#11128)

Updated the method to properly fetch and return workspace data with
related approved access domains. This ensures the correct handling of
workspace lookup and fixes potential issues with undefined returns.

Fix #10982
This commit is contained in:
Antoine Moreaux
2025-03-24 20:24:58 +01:00
committed by GitHub
parent fd23a6e5ff
commit 54e346a2aa
3 changed files with 8 additions and 3 deletions

View File

@ -85,7 +85,7 @@ export const SettingsListCard = <
description={getItemDescription?.(item)}
rightComponent={<RowRightComponent item={item} />}
divider={index < items.length - 1}
onClick={() => onRowClick?.(item)}
onClick={onRowClick ? () => onRowClick?.(item) : undefined}
to={to?.(item)}
/>
))}

View File

@ -423,7 +423,7 @@ describe('AuthService', () => {
});
expect(result).toBeUndefined();
expect(spyWorkspaceRepository).toHaveBeenCalledTimes(0);
expect(spyWorkspaceRepository).toHaveBeenCalledTimes(1);
expect(spyAuthSsoService).toHaveBeenCalledTimes(0);
});
it('findWorkspaceForSignInUp - signup password auth with workspaceInviteHash', async () => {

View File

@ -562,7 +562,12 @@ export class AuthService {
);
}
return undefined;
return await this.workspaceRepository.findOne({
where: {
id: params.workspaceId,
},
relations: ['approvedAccessDomains'],
});
}
formatUserDataPayload(