Skip to content

refactor(api): port auth routes - #173

Merged
didinele merged 1 commit into
mainfrom
refactor/port-auth-routes
Jul 17, 2026
Merged

refactor(api): port auth routes#173
didinele merged 1 commit into
mainfrom
refactor/port-auth-routes

Conversation

@didinele

@didinele didinele commented Jul 17, 2026

Copy link
Copy Markdown
Member

Closes #129

Summary by CodeRabbit

  • Authentication

    • Updated Discord sign-in, callback, logout, and account-information flows while preserving existing behavior.
    • Improved handling of authentication errors, expired sessions, invalid callbacks, and unexpected permission responses.
    • Verified redirects and failure scenarios across authentication flows.
  • Documentation

    • Updated the authentication migration checklist with completion status, current integration notes, and manual verification results.
    • Added a reminder to validate interactive Discord login with a live Discord application.

@vercel

vercel Bot commented Jul 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
chatsift-website Error Error Jul 17, 2026 9:04am

@didinele

didinele commented Jul 17, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The four auth routes were migrated from class-based Route implementations to defineRoute definitions. Auth route type and reflection exports were removed, while the roadmap records migration status, verification results, and temporary frontend type limitations.

Changes

Auth route migration

Layer / File(s) Summary
OAuth route definitions
services/api/src/routes/auth/discord.ts, services/api/src/routes/auth/discordCallback.ts
Discord authorization and callback routes now use defineRoute, explicit response termination, and thrown Boom errors for invalid state, expiry, and scope mismatches.
Session route definitions
services/api/src/routes/auth/logout.ts, services/api/src/routes/auth/me.ts
Logout and current-user routes now use defineRoute handlers while preserving authentication, token handling, query processing, and fetchMe() behavior.
Route surface and migration record
services/api/src/routes/_types/routeTypes.ts, services/api/src/routes/routes.ts, docs/roadmap/02-foundation.md
Auth route exports were removed from route barrels, and the roadmap documents completion, verification results, database access, and temporary frontend type failures.

Estimated code review effort: 3 (Moderate) | ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: porting the API auth routes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/port-auth-routes

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 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 `@services/api/src/routes/routes.ts`:
- Around line 3-6: Update the route migration so the frontend auth and AMA
consumers retain compatible TypeScript exports until `#131` lands: either merge
the replacement API migration with this change or preserve the existing route
type exports from the reflection barrel. Ensure strict TypeScript consumers in
apps/website continue to typecheck while the defineRoute-based routes remain
supported.
🪄 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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 16508a07-2e97-4b08-a7bc-e207b58a2d0e

📥 Commits

Reviewing files that changed from the base of the PR and between 06a95ac and 93e1bfb.

📒 Files selected for processing (7)
  • docs/roadmap/02-foundation.md
  • services/api/src/routes/_types/routeTypes.ts
  • services/api/src/routes/auth/discord.ts
  • services/api/src/routes/auth/discordCallback.ts
  • services/api/src/routes/auth/logout.ts
  • services/api/src/routes/auth/me.ts
  • services/api/src/routes/routes.ts
💤 Files with no reviewable changes (1)
  • services/api/src/routes/_types/routeTypes.ts

Comment thread services/api/src/routes/routes.ts
@didinele
didinele merged commit dee1420 into main Jul 17, 2026
9 of 12 checks passed
@didinele
didinele deleted the refactor/port-auth-routes branch July 17, 2026 09:22
@coderabbitai coderabbitai Bot mentioned this pull request Jul 19, 2026
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.

Migrate auth routes (x4) to defineRoute + raw SQL

1 participant