Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactored /logout route #244

Merged
merged 2 commits into from
Dec 9, 2023
Merged

Conversation

Rachit1313
Copy link
Contributor

Certainly! Here's a pull request (PR) description for the refactoring of the "/logout" route:


Pull Request: Refactor "/logout" Route

Description:
This PR focuses on enhancing the "/logout" route within packages/server/src/api_auth/index.ts. The primary goal is to improve code structure by utilizing res.locals.reqClientData as the source for client data, replacing direct accesses to req.body, req.query, and req.params. Additionally, a try-catch block has been introduced for effective error handling, following the approach used in the "login" route within the same folder.

Changes Made:

  1. Replaced direct accesses to req.body, req.query, and req.params with res.locals.reqClientData.
  2. Ensured consistent retrieval of client data from res.locals.reqClientData.
  3. Introduced a try-catch block to handle errors gracefully.
  4. Customized error messages and responses for meaningful feedback.
  5. Tested the refactored "/logout" route to ensure correct functionality.
  6. No documentation changes required.

Testing:

  • Tested the refactored "/logout" route to confirm correct functionality.
  • Verified that error handling is effective in different scenarios.

closes #241

Copy link
Owner

@prasenjeet-symon prasenjeet-symon left a comment

Choose a reason for hiding this comment

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

We appreciate your hard work but please resolve the commented issue and submit again. Thanks

Copy link
Owner

@prasenjeet-symon prasenjeet-symon left a comment

Choose a reason for hiding this comment

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

Thanks for your valuable contribution.

@prasenjeet-symon prasenjeet-symon merged commit 90c4010 into prasenjeet-symon:main Dec 9, 2023
@prasenjeet-symon prasenjeet-symon added enhancement New feature or request server related to server high-priority labels Dec 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request high-priority server related to server
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor "/logout" Route for Improved Code Structure
2 participants