edit:module:auth:*logout | add single line documentation for logout module

This commit is contained in:
2025-06-19 17:22:05 +07:00
parent ac82676505
commit 617444591f
3 changed files with 15 additions and 1 deletions

View File

@ -7,14 +7,19 @@ export const deleteUserSessionInCacheAndDBService = async (
jwtToken: JWTAuthToken
) => {
try {
// Construct the userId and sessionId from the JWT token
const userId = jwtToken.userId;
const sessionId = jwtToken.id;
// Delete the user session from cache and database
await deleteUserSessionFromCacheRepo(userId, sessionId);
const deleteUserSessionFromDB = await deleteUserSessionFromDBRepo(
sessionId
);
return deleteUserSessionFromDB;
// If the session was not found in the cache or database, throw an error
} catch (error) {
ErrorForwarder(
error,