Enhance Paddle integration and improve social auth visibility#3527
Conversation
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis PR restricts social auth button visibility to staging and local test environments, and refactors how Paddle payment SDK environment configuration is initialized. The Paddle changes improve flexibility by removing hardcoded environment mapping and allowing the SDK itself to manage configuration. ChangesEnvironment-based Configuration Updates
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/platform/src/shared/components/auth/SocialAuthSection.tsx`:
- Around line 61-67: The current shouldShowSocialAuth function uses
normalizedHostname.includes('staging') which is too broad; update it to only
match explicit staging hostnames (e.g., exact "staging" or subdomains that start
with "staging.") instead of any hostname containing the substring. Modify
shouldShowSocialAuth to check (normalizedHostname === 'staging' ||
normalizedHostname.startsWith('staging.')) in addition to the existing
LOCAL_TEST_HOSTNAMES.has(normalizedHostname) check so only intended staging
hosts get social auth enabled.
In `@src/platform/src/shared/lib/paddle.ts`:
- Around line 7-8: getPaddleEnvironment currently returns any trimmed
NEXT_PUBLIC_PAYMENT_ENVIRONMENT and may pass invalid values into
Paddle.Environment.set; change getPaddleEnvironment to validate the trimmed
value and only return "sandbox" or "production" (exact match), otherwise return
undefined (so Paddle.Environment.set is not called with unsupported values).
Locate getPaddleEnvironment in src/shared/lib/paddle.ts, normalize and trim the
env var, compare against the allowed set ["sandbox","production"], and return
the matching string or undefined to enforce a fail-closed behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 0bc99c92-f0fd-4e40-952e-d4ebb412d069
📒 Files selected for processing (3)
src/platform/src/shared/components/auth/SocialAuthSection.tsxsrc/platform/src/shared/lib/paddle.tssrc/platform/src/shared/providers/paddle-provider.tsx
|
New azure analytics_platform changes available for preview here |
|
New azure analytics_platform changes available for preview here |
Status of maturity (all need to be checked before merging):
Screenshots (optional)
Summary by CodeRabbit