"use strict";(()=>{var e={};e.id=6113,e.ids=[6113],e.modules={53524:e=>{e.exports=require("@prisma/client")},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")},53648:(e,t,n)=>{n.r(t),n.d(t,{originalPathname:()=>x,patchFetch:()=>g,requestAsyncStorage:()=>p,routeModule:()=>c,serverHooks:()=>m,staticGenerationAsyncStorage:()=>d});var s={};n.r(s),n.d(s,{POST:()=>l});var r=n(49303),a=n(88716),o=n(60670),i=n(87070),u=n(90455);async function l(){return await (0,u.Ov)(),i.NextResponse.json({success:!0})}let c=new r.AppRouteRouteModule({definition:{kind:a.x.APP_ROUTE,page:"/api/user/logout/route",pathname:"/api/user/logout",filename:"route",bundlePath:"app/api/user/logout/route"},resolvedPagePath:"C:\\Users\\MSI\\Downloads\\film\\app\\api\\user\\logout\\route.ts",nextConfigOutput:"standalone",userland:s}),{requestAsyncStorage:p,staticGenerationAsyncStorage:d,serverHooks:m}=c,x="/api/user/logout/route";function g(){return(0,o.patchFetch)({serverHooks:m,staticGenerationAsyncStorage:d})}},90455:(e,t,n)=>{n.d(t,{Gg:()=>d,KY:()=>p,Ov:()=>m});var s=n(86890),r=n(41463),a=n(71615),o=n(72331);let i=process.env.JWT_SECRET_KEY||"rahasia-super-aman-ganti-di-env",u=new TextEncoder().encode(i);async function l(e){return await new s.N(e).setProtectedHeader({alg:"HS256"}).setIssuedAt().setExpirationTime("24h").sign(u)}async function c(e){try{let{payload:t}=await (0,r._)(e,u);return t}catch(e){return null}}async function p(e,t,n){let s=await l({userId:e,role:t,sessionToken:n}),r=new Date(Date.now()+864e5);(0,a.cookies)().set("admin_session",s,{expires:r,httpOnly:!0,secure:!0,sameSite:"lax",path:"/"})}async function d(){let e=a.cookies().get("admin_session")?.value;if(!e)return null;let t=await c(e);if(!t||!t.userId||!t.sessionToken)return null;let n=await o._.user.findUnique({where:{id:t.userId},select:{sessionToken:!0}});return n&&n.sessionToken===t.sessionToken?t:null}async function m(){(0,a.cookies)().delete("admin_session")}},72331:(e,t,n)=>{n.d(t,{_:()=>r});var s=n(53524);let r=global.prisma||new s.PrismaClient}};var t=require("../../../../webpack-runtime.js");t.C(e);var n=e=>t(t.s=e),s=t.X(0,[8948,5972,3112],()=>n(53648));module.exports=s})();