Skip to content

[Feature]: Refactor Auth Controller for Code Reuse & Readability #74

@akofficial10

Description

@akofficial10

Description:
The register and login controllers currently work fine, but they contain repeated logic such as:

  1. Input normalization (trimming and lowercasing strings).
  2. Building the user response object.
  3. Handling repeated validation patterns.

This repetition makes the code harder to maintain and more error-prone when future changes are needed (e.g., updating the response structure).

Expected improvement:

  1. Reduce duplication in the auth controller.
  2. Improve readability and maintainability.
  3. Keep functionality, validation, and API responses exactly the same.

Metadata

Metadata

Assignees

Labels

GSSoC'25Part of GSSoC'25 programbugSomething isn't workingenhancementNew feature or requestlevel 1Beginner/easy

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions