fix: Improve PKCE cookie missing error message#46
fix: Improve PKCE cookie missing error message#46devin-ai-integration[bot] wants to merge 1 commit into
Conversation
Replace the technical error message with a more user-friendly, solution-oriented message that advises the user to try signing in again rather than referencing internal implementation details like Set-Cookie header propagation.
Original prompt from garen.torikian
|
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
| throw new PKCECookieMissingError( | ||
| 'PKCE verifier cookie missing — cannot verify OAuth state. Ensure Set-Cookie headers are propagated on redirects.', | ||
| 'Sign-in session could not be verified. Please try signing in again.', | ||
| ); |
There was a problem hiding this comment.
Developer-facing context removed from diagnostic message
PKCECookieMissingError is a publicly exported error class that library integrators are expected to catch and handle (e.g., redirect to sign-in). In a properly implemented adapter the message never reaches end users, so the old phrasing ("Ensure Set-Cookie headers are propagated on redirects") served as actionable debug guidance for developers integrating this SDK. The new message is less useful when someone is actively debugging a proxy/cookie-stripping issue and has not yet caught or read the JSDoc. Worth keeping in mind if the team plans to use this message in telemetry or logging — it will no longer carry the root-cause signal.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
Acknowledged — this is an intentional tradeoff. The error class name (PKCECookieMissingError) and JSDoc already carry the diagnostic signal for integrators who catch it. The message change targets the case where the error propagates to an end user (e.g., via a framework that surfaces error.message without custom handling). The original proxy-oriented guidance remains documented in MIGRATION.md for anyone debugging cookie-stripping issues.
Summary
Replaces the technical
PKCECookieMissingErrormessage with a user-friendly, solution-oriented alternative.Before:
"PKCE verifier cookie missing — cannot verify OAuth state. Ensure Set-Cookie headers are propagated on redirects."After:
"Sign-in session could not be verified. Please try signing in again."The old message exposed internal implementation details (PKCE, OAuth state, Set-Cookie headers) that aren't actionable for end users. The new message covers all failure scenarios (session expiry, proxy stripping cookies, etc.) and directs the user toward the correct resolution without leaking technical specifics.
Link to Devin session: https://app.devin.ai/sessions/a078971ce8c94657a457d1a099232333