"use strict";(()=>{var e={};e.id=7716,e.ids=[7716],e.modules={72934:e=>{e.exports=require("next/dist/client/components/action-async-storage.external.js")},54580:e=>{e.exports=require("next/dist/client/components/request-async-storage.external.js")},45869:e=>{e.exports=require("next/dist/client/components/static-generation-async-storage.external.js")},20399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},30517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},72496:(e,t,r)=>{r.r(t),r.d(t,{originalPathname:()=>g,patchFetch:()=>x,requestAsyncStorage:()=>l,routeModule:()=>p,serverHooks:()=>h,staticGenerationAsyncStorage:()=>d});var o={};r.r(o),r.d(o,{POST:()=>c});var a=r(49303),s=r(88716),n=r(60670),u=r(87070),i=r(71615);async function c(e){try{let e=(0,i.cookies)();e.delete("auth-token"),e.delete("user-data"),e.delete("user");let t=e.get("auth-token")?.value;if(t)try{await fetch("https://dev.skyloria-travel.com/api/logout",{method:"POST",headers:{Authorization:`${t}`,"Content-Type":"application/json"}})}catch(e){console.error("Error invalidating token on server:",e)}return u.NextResponse.json({success:!0,message:"Logged out successfully"},{status:200,headers:{"Set-Cookie":"auth-token=; Path=/; Expires=Thu, 01 Jan 1970 00:00:00 GMT; HttpOnly; Secure; SameSite=Strict, user-data=; Path=/; Expires=Thu, 01 Jan 1970 00:00:00 GMT; Secure; SameSite=Strict, user=; Path=/; Expires=Thu, 01 Jan 1970 00:00:00 GMT; Secure; SameSite=Strict"}})}catch(e){return console.error("Logout error:",e),u.NextResponse.json({success:!1,message:"Logout failed"},{status:500})}}let p=new a.AppRouteRouteModule({definition:{kind:s.x.APP_ROUTE,page:"/api/auth/logout/route",pathname:"/api/auth/logout",filename:"route",bundlePath:"app/api/auth/logout/route"},resolvedPagePath:"C:\\Users\\Administrator\\Documents\\sky-i18n\\app\\api\\auth\\logout\\route.ts",nextConfigOutput:"standalone",userland:o}),{requestAsyncStorage:l,staticGenerationAsyncStorage:d,serverHooks:h}=p,g="/api/auth/logout/route";function x(){return(0,n.patchFetch)({serverHooks:h,staticGenerationAsyncStorage:d})}}};var t=require("../../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),o=t.X(0,[8948,1615,5972],()=>r(72496));module.exports=o})();