This PR is #242 Pull Request: Enhance "/logout_all" Route Refactoring
Summary:
This pull request aims to improve the "/logout_all" route located in packages/server/src/api_auth/index.ts. The main objective is to enhance the code structure by using res.locals.reqClientData as the main source for client data instead of direct accesses to req.body, req.query, and req.params. Additionally, it introduces a robust try-catch block for effective error handling, aligning with the established methodology seen in the "login" route within the same directory.
Changes Implemented:
The following changes have been made:
Instead of directly accessing req.body, req.query, and req.params, they are now being accessed through res.locals.reqClientData via the refactored IRequestAuthLogoutAll Interface.
The way client data is extracted from res.locals.reqClientData has been made consistent throughout the codebase.
A try-catch block has been added to handle errors in a more graceful manner.
Error messages and responses have been customized to provide more informative feedback.
The updated "/logout_all" route has been thoroughly tested to ensure smooth functionality.
No changes are needed in the documentation.
Testing Details:
Thoroughly tested the refactored "/logout_all" route to confirm its functionality.
Verified the effectiveness of error handling across diverse scenarios.
This PR is #242 Pull Request: Enhance "/logout_all" Route Refactoring
Summary: This pull request aims to improve the
"/logout_all"
route located inpackages/server/src/api_auth/index.ts.
The main objective is to enhance the code structure by usingres.locals.reqClientData
as the main source for client data instead of direct accesses toreq.body
,req.query
, andreq.params
. Additionally, it introduces a robust try-catch block for effective error handling, aligning with the established methodology seen in the "login" route within the same directory.Changes Implemented:
The following changes have been made:
req.body
,req.query
, andreq.params
, they are now being accessed throughres.locals.reqClientData
via the refactoredIRequestAuthLogoutAll
Interface.res.locals.reqClientData
has been made consistent throughout the codebase."/logout_all"
route has been thoroughly tested to ensure smooth functionality.Testing Details: