The validation was comparing image height to itself instead of comparing height to width, causing the square check to always pass even for non-square images.
Co-authored-by: Dhairyashil Shinde <93669429+dhairyashiil@users.noreply.github.com>
* fix: prevent base64 logo/banner storage in organization onboarding
- Add processOnboardingBrandAssets helper method to BaseOnboardingService
- Process base64 images and upload them before storing in database
- Use uploadAvatar with userId to avoid foreign key issues before Team exists
- Handle both create and update/resume flows
- Ensure OrganizationOnboarding and Team records store regular URLs not base64
- Fixes header size issues when logoUrl is added to session cookies
Co-Authored-By: hariom@cal.com <hariombalhara@gmail.com>
* fix: use processed URLs from OrganizationOnboarding record
- Update SelfHostedOnboardingService to use organizationOnboarding.logo/bannerUrl instead of raw input
- Update BillingEnabledOrgOnboardingService payment intent to use processed URLs
- Ensures Team records receive processed URLs, not base64 data
Co-Authored-By: hariom@cal.com <hariombalhara@gmail.com>
* refactor: remove unused variables and imports
Co-Authored-By: hariom@cal.com <hariombalhara@gmail.com>
* refactor: extract image processing to helper method and add tests
- Created private processImageField() method to eliminate code duplication
- Uses regex for more robust data URI and URL detection
- Processes logo and bannerUrl in parallel with Promise.all
- Added 2 important tests for base64 image processing:
1. Verifies base64 conversion with correct resize options (bannerUrl uses maxSize: 1500)
2. Validates undefined vs null semantics (no-op vs explicit clear)
- Fixed pre-existing lint warnings by replacing 'any' types with proper types
Co-Authored-By: hariom@cal.com <hariombalhara@gmail.com>
* Improve code
* Fixup organizationId
* simplify
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Alex van Andel <me@alexvanandel.com>