{"version":3,"file":"CkQKCmDK.js","sources":["../../../../composables/useLogout.ts"],"sourcesContent":["import { API_ENDPOINT } from \"~/constants/api-endpoint\";\nimport { useApi } from \"~/composables/useApi\";\nimport { useRootStore } from \"~/stores/root-store\";\n\n/**\n * Composable for handling user logout functionality\n * Clears user session data and navigates to the login page\n */\nexport function useLogout() {\n /**\n * Logs out the user by clearing session data and navigating to the login page\n */\n const logout = (): void => {\n // Call the logout API endpoint\n useApi().get(API_ENDPOINT.LOGOUT);\n\n // Clear local storage\n localStorage.clear();\n\n // Clear the root store\n useRootStore().clearStore();\n\n // Remove authentication cookies\n useCookie(\"Token\", {\n maxAge: 0,\n path: \"/\",\n sameSite: \"strict\",\n }).value = \"\";\n\n useCookie(\"RefreshToken\", {\n maxAge: 0,\n path: \"/\",\n sameSite: \"strict\",\n }).value = \"\";\n\n // Navigate to the login page\n navigateTo(\"/login\");\n };\n\n return { logout };\n}\n"],"names":["useLogout","useApi","API_ENDPOINT","useRootStore","useCookie","navigateTo"],"mappings":"sHAQO,SAASA,GAAY,CA+B1B,MAAO,CAAE,OA3BM,IAAY,CAElBC,IAAE,IAAIC,EAAa,MAAM,EAGhC,aAAa,MAAM,EAGnBC,EAAA,EAAe,WAAW,EAG1BC,EAAU,QAAS,CACjB,OAAQ,EACR,KAAM,IACN,SAAU,QAAA,CACX,EAAE,MAAQ,GAEXA,EAAU,eAAgB,CACxB,OAAQ,EACR,KAAM,IACN,SAAU,QAAA,CACX,EAAE,MAAQ,GAGXC,EAAW,QAAQ,CACrB,CAEgB,CAClB"}