Skip to content

Conversation

@RodrigoRafaelSantos7
Copy link
Owner

@RodrigoRafaelSantos7 RodrigoRafaelSantos7 commented Nov 7, 2025

Fix: Exclude Anonymous Sign-In Path from Convex Adapter Hook

Summary

Fixed the anonymous plugin issue with the Convex adapter.

Change Made

  • Updated the after hook matcher in src/plugins/convex/index.ts to exclude /sign-in/anonymous from matching.
  • The matcher now checks:
    • ctx.path.startsWith("/sign-in") && !ctx.path.startsWith("/sign-in/anonymous")
    • This ensures anonymous sign-in paths are excluded.

What This Fixes

  • Prevents onLinkAccount from running during sign.anonymous — the Convex plugin’s after hook no longer matches anonymous sign-in paths.
  • Allows the anonymous plugin’s hooks to complete first — the Convex hook won’t run prematurely.
  • Reduces interference with anonymous user management — anonymous sign-in is handled by the anonymous plugin’s own hooks.

Rationale

The fix is minimal and targeted: it only excludes the anonymous sign-in path from the JWT token generation hook, allowing the anonymous plugin to handle its own flow without premature account linking logic.

Quality Assurance

  • No linting errors were introduced.
  • Maintains backward compatibility with all other sign-in methods.

Summary by CodeRabbit

  • Bug Fixes
    • Improved sign-in flow handling by ensuring the anonymous sign-in route is processed independently from the standard sign-in route, preventing unintended routing behavior.

@RodrigoRafaelSantos7 RodrigoRafaelSantos7 merged commit 4b077fc into main Nov 7, 2025
@coderabbitai
Copy link

coderabbitai bot commented Nov 7, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The after-hook matcher for sign-in routes in the Convex plugin was narrowed to exclude the /sign-in/anonymous subpath. The matcher now requires that paths starting with /sign-in must not also start with /sign-in/anonymous, modifying which endpoints trigger the after hook.

Changes

Cohort / File(s) Change Summary
Sign-in route matcher refinement
src/plugins/convex/index.ts
Narrowed after-hook matcher logic to exclude /sign-in/anonymous subpath from triggering sign-in flow hooks

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • The change is localized to a single file with a focused matcher adjustment
  • Requires understanding the routing logic and verifying the matcher condition correctly excludes the anonymous path

Poem

🐰 A hook hops and skips, with path logic refined,
Anonymous sign-ins now left behind,
The matcher takes care, with precision so keen,
Each route finds its place in the flow serene! 🌟

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-anon-sign-in-path-b1c9b

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1cda1af and bcb09ff.

📒 Files selected for processing (1)
  • src/plugins/convex/index.ts (1 hunks)

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants