import{withPathPrefix as t}from"@redocly/theme/core/utils";import{ServerRoutes as e}from"../../../constants/index.js";import{usePageData as r}from"../hooks/usePageData";import{useLoginUrl as a}from"../hooks/useLoginUrl";async function n(){try{await fetch(t(e.LOGOUT),{method:"POST"})}catch(o){console.error(o)}}function f(){const{userData:o}=r("userData")||{};return{loginUrl:a(),userData:o,handleLogout:async()=>{await n(),window.location.replace(t(e.LOGOUT))}}}export{f as useUserMenu};
