🧹 [code health] Refactor monolithic Auth controller method logic by extracting cookie helpers#20
Conversation
Extracts the monolithic cookie handling in `nexus/backend/src/auth/auth.controller.ts` into a dedicated `auth/helpers/cookie.helper.ts` module, exposing `setAuthCookies` and `clearAuthCookies`. This improves modularity and cleans up the controller logic. Co-authored-by: Adityavanjre <66417028+Adityavanjre@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Free Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR refactors authentication cookie management by extracting cookie-setting and cookie-clearing logic from the auth controller into a reusable helper module. The helper centralizes CSRF token generation and cookie attribute configuration, while the controller now delegates all cookie operations to these shared functions across login, registration, MFA, refresh, and logout flows. ChangesAuth Cookie Helper Extraction
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Comment |
…flict Extracts the monolithic cookie handling in `nexus/backend/src/auth/auth.controller.ts` into a dedicated `auth/helpers/cookie.helper.ts` module, exposing `setAuthCookies` and `clearAuthCookies`. This improves modularity and cleans up the controller logic. Also fixes a CI failure where `ajv` version `^6.12.6` was causing `npx nest build` to fail by updating the `package.json` override for `ajv` to `^8.18.0` as indicated in repository memory. Co-authored-by: Adityavanjre <66417028+Adityavanjre@users.noreply.github.com>
Extracts the monolithic cookie handling in `nexus/backend/src/auth/auth.controller.ts` into a dedicated `auth/helpers/cookie.helper.ts` module, exposing `setAuthCookies` and `clearAuthCookies`. This improves modularity and cleans up the controller logic. Co-authored-by: Adityavanjre <66417028+Adityavanjre@users.noreply.github.com>
🎯 What: Extracted response cookie settings into an auth helper module.
💡 Why: Centralizes the core authentication cookie management logic, making the
AuthControllerless monolithic and the cookie setup logic reusable and easier to test independently. This improves code health and maintainability.✅ Verification: Verified by ensuring the code logic is 1:1 with previous execution, running the test suite to ensure no tests regressed, and validating with code review tooling.
✨ Result: A highly modular, cleaner
auth.controller.tswith no behavioral changes.PR created automatically by Jules for task 9033528662927682081 started by @Adityavanjre
Summary by CodeRabbit