dsql-admin/dsql-app/.local_dist/server/pages/api/logoutUser.js

1 line
1.9 KiB
JavaScript
Raw Normal View History

2025-01-13 08:00:21 +00:00
"use strict";(()=>{var e={};e.id=528,e.ids=[528],e.modules={75600:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},29021:e=>{e.exports=require("fs")},96762:(e,r)=>{Object.defineProperty(r,"M",{enumerable:!0,get:function(){return function e(r,t){return t in r?r[t]:"then"in r&&"function"==typeof r.then?r.then(r=>e(r,t)):"function"==typeof r&&"default"===t?r:void 0}}})},59805:(e,r,t)=>{t.r(r),t.d(r,{config:()=>_,default:()=>i,routeModule:()=>l});var n={};t.r(n),t.d(n,{default:()=>d});var u=t(89947),s=t(2706),o=t(96762),a=t(89159);async function d(e,r){if("GET"!==e.method)return r.json({msg:"Logout Error"});{let{keyCookieName:e,csrfCookieName:t}=(0,a.A)();r.setHeader("Set-Cookie",[`${e}=null;max-age=0`,`${t}=null;max-age=0`]),r.json({msg:"Logged Out"})}}t(29021);let i=(0,o.M)(n,"default"),_=(0,o.M)(n,"config"),l=new u.PagesAPIRouteModule({definition:{kind:s.A.PAGES_API,page:"/api/logoutUser",pathname:"/api/logoutUser",bundlePath:"",filename:""},userland:n})},89159:(e,r,t)=>{t.d(r,{A:()=>n});function n(e){let r=process.env.DSQL_COOKIES_PREFIX||"dsql_",t=process.env.DSQL_COOKIES_KEY_NAME||"key",n=process.env.DSQL_COOKIES_CSRF_NAME||"csrf",u=process.env.DSQL_COOKIES_ONE_TIME_CODE_NAME||"one-time-code",s=e?.database?.replace(/^datasquirel_user_\d+_/,"")||process.env.DSQL_DB_NAME?.replace(/^datasquirel_user_\d+_/,""),o=r;e?.userId&&(o+=`user_${e.userId}_`),s&&(o+=`${s}_`),o+=t;let a=r;e?.userId&&(a+=`user_${e.userId}_`),s&&(a+=`${s}_`),a+=n;let d=r;return e?.userId&&(d+=`user_${e.userId}_`),s&&(d+=`${s}_`),{keyCookieName:o,csrfCookieName:a,oneTimeCodeName:d+=u}}},2706:(e,r)=>{Object.defineProperty(r,"A",{enumerable:!0,get:function(){return t}});var t=function(e){return e.PAGES="PAGES",e.PAGES_API="PAGES_API",e.APP_PAGE="APP_PAGE",e.APP_ROUTE="APP_ROUTE",e.IMAGE="IMAGE",e}({})},89947:(e,r,t)=>{e.exports=t(75600)}};var r=require("../../webpack-api-runtime.js");r.C(e);var t=r(r.s=59805);module.exports=t})();