Skip to content

Conversation

@spike014
Copy link
Contributor

@spike014 spike014 commented Sep 30, 2025

  • Remove duplicate src/lib/auth.ts file
  • Update middleware.ts to use @/modules/auth/utils/auth-utils
  • Maintain backward compatibility with aliasing
  • Reduce code duplication and improve project structure

🤖 Generated with Claude Code

FYI: Claude Code fixed it with my prompts. @ifindev

Summary by CodeRabbit

  • Refactor

    • Centralized authentication utilities and updated middleware to use the shared module.
    • No changes to sign-in, session handling, or redirect behavior.
  • Chores

    • Removed deprecated authentication code to reduce duplication and streamline maintenance.

…logic

- Remove duplicate src/lib/auth.ts file
- Update middleware.ts to use @/modules/auth/utils/auth-utils
- Maintain backward compatibility with aliasing
- Reduce code duplication and improve project structure

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@coderabbitai
Copy link

coderabbitai bot commented Sep 30, 2025

Walkthrough

Authentication utility source is switched in middleware.ts to an aliased path. The legacy auth implementation at src/lib/auth.ts is deleted. Middleware logic and exported signatures remain unchanged.

Changes

Cohort / File(s) Summary of Changes
Auth import refactor
middleware.ts
Updated import from ./src/lib/auth to @/modules/auth/utils/auth-utils with aliasing (getAuthInstance as getAuth); no logic changes in middleware.
Legacy auth module removal
src/lib/auth.ts
Deleted the entire file, removing the prior getAuth singleton factory and its Better-Auth/DB integration.

Sequence Diagram(s)

(no diagrams)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

A whisk of code, a hop to new burrows bright,
Old auth burrow gone, new tunnel in sight.
I twitch my nose at imports neat,
Same path through woods, just lighter feet.
Carrot commits stacked—merge tonight! 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title “refactor: remove duplicate auth module and centralize authentication logic” directly summarizes the primary change in this pull request by highlighting the removal of the redundant auth module and the shift to a centralized authentication utility, which aligns precisely with the modifications in src/lib/auth.ts deletion and the updated import in middleware.ts. It is concise, specific, and free of extraneous detail, making the intent immediately clear to reviewers.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

@ifindev
Copy link
Owner

ifindev commented Sep 30, 2025

Great catch @spike014! I noticed the issue last week, but got busy with other work. So, thanks for the fix!

@ifindev ifindev merged commit 1b2019b into ifindev:main Sep 30, 2025
1 check passed
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