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

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

View File

@ -4,11 +4,15 @@ import { deleteUserSessionInCacheAndDBService } from "../../userSession/services
export const logoutService = async (userCookie: string) => {
try {
// Decode the JWT token to get the user session
const jwtToken = jwtDecode(userCookie);
// Delete the user session from cache and database
const deleteUserSessionInCacheAndDB =
deleteUserSessionInCacheAndDBService(jwtToken);
return deleteUserSessionInCacheAndDB;
// If the session was not found in the cache or database, throw an error
} catch (error) {
ErrorForwarder(error, 500, "Logout service had encountered error");
}