🚚 create backup folder

create backup folder for archive the old modules
This commit is contained in:
Rafi Arrafif
2025-07-18 23:20:15 +07:00
parent 8eb68cf0ba
commit 8532d7e104
40 changed files with 671 additions and 671 deletions

View File

@ -0,0 +1,19 @@
import { ErrorForwarder } from "../../../helpers/error/instances/forwarder";
import { jwtDecode } from "../../../helpers/http/jwt/decode";
import { deleteUserSessionInCacheAndDBService } from "../../userSession/services/deleteUserSessionInCacheAndDB.service";
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");
}
};