Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughTwo files were modified to simplify consent logic by removing Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
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.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/auth-service/src/routes/complete.ts (1)
102-109:⚠️ Potential issue | 🟠 MajorPreserve the real new-account flag when redirecting to consent.
Line 108 now forces
new=0for every consent flow, so brand-new signups will render the existing-account consent UI.packages/auth-service/src/routes/consent.ts:27-88derivesisNewfrom that query param, andpackages/auth-service/src/routes/consent.ts:180-233uses it for the page title, the “A new account will be created” notice, and the hiddenis_newfield. We should keep the stricterneedsConsentlogic, but still pass throughisNewAccounthere.Suggested fix
consentUrl.searchParams.set('flow_id', flowId) consentUrl.searchParams.set('email', email) - consentUrl.searchParams.set('new', '0') + consentUrl.searchParams.set('new', isNewAccount ? '1' : '0') res.redirect(303, consentUrl.pathname + consentUrl.search) return🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/auth-service/src/routes/complete.ts` around lines 102 - 109, The redirect to the consent page currently forces consentUrl.searchParams.set('new', '0'), which overwrites the real new-account flag; instead use the existing isNewAccount value when building the consentUrl (e.g., set 'new' to isNewAccount ? '1' : '0' or the string form used elsewhere) so the consent handler (isNew derived from that query param) receives the correct flag; update the construction that sets 'new' to reference the isNewAccount variable (leave flowId, email, and needsConsent logic unchanged) and then call res.redirect with consentUrl.pathname + consentUrl.search as before.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@packages/auth-service/src/routes/complete.ts`:
- Around line 102-109: The redirect to the consent page currently forces
consentUrl.searchParams.set('new', '0'), which overwrites the real new-account
flag; instead use the existing isNewAccount value when building the consentUrl
(e.g., set 'new' to isNewAccount ? '1' : '0' or the string form used elsewhere)
so the consent handler (isNew derived from that query param) receives the
correct flag; update the construction that sets 'new' to reference the
isNewAccount variable (leave flowId, email, and needsConsent logic unchanged)
and then call res.redirect with consentUrl.pathname + consentUrl.search as
before.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 990c6a60-ebe8-4304-a065-b42e60b30c63
📒 Files selected for processing (2)
packages/auth-service/src/routes/complete.tspackages/pds-core/src/index.ts
💤 Files with no reviewable changes (1)
- packages/pds-core/src/index.ts
Previously the condition to show the consent page was
if !newAccountbut this doesnt make sense since its still good to display what perms the app is asking.Also the stock pds also displays the consent page even if theyre creating a new account
Summary by CodeRabbit