prasenjeet-symon / intellectia

Intellectia - Your Guardian Against Misleading AI-Generated Content
MIT License
15 stars 45 forks source link

Refactor "/google" Route for Improved Code Structure #233

Closed prasenjeet-symon closed 9 months ago

prasenjeet-symon commented 9 months ago

Description: This GitHub issue focuses on refactoring the "/google" route within the packages/server/src/api_auth/index.ts file. The objective is to enhance the code structure by utilizing res.locals.reqClientData as the source for client data, eliminating direct access to req.body, req.query, and req.params. The refactoring should also implement error handling using a try-catch block, following the error handling approach in the "login" route within the same folder.

Tasks:

  1. Code Refactoring:

    • [ ] Review the existing "/google" route in packages/server/src/api_auth/index.ts.
    • [ ] Replace direct accesses to req.body, req.query, and req.params with res.locals.reqClientData.
    • [ ] Ensure consistent retrieval of client data from res.locals.reqClientData.
  2. Error Handling:

    • [ ] Implement a try-catch block to handle errors gracefully.
    • [ ] Customize error messages and responses for meaningful feedback.
  3. Testing:

    • [ ] Test the refactored "/google" route to ensure it functions correctly.
    • [ ] Verify that error handling is effective in different scenarios.
  4. Documentation:

    • [ ] Update any relevant documentation to reflect the changes made to the "/google" route.

Acceptance Criteria:

Additional Information:

sabbellasri commented 9 months ago

Hi @prasenjeet-symon I am interested to work in this issue. will u assign it to me?

prasenjeet-symon commented 9 months ago

Hi @prasenjeet-symon I am interested to work in this issue. will u assign it to me?

Yes assigned to you