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

1 line
1.9 KiB
JavaScript
Raw Normal View History

2025-01-14 06:42:13 +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")},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),o=t(2706),s=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"})}}let i=(0,s.M)(n,"default"),_=(0,s.M)(n,"config"),l=new u.PagesAPIRouteModule({definition:{kind:o.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",o=e?.database?.replace(/^datasquirel_user_\d+_/,"")||process.env.DSQL_DB_NAME?.replace(/^datasquirel_user_\d+_/,""),s=r;e?.userId&&(s+=`user_${e.userId}_`),o&&(s+=`${o}_`),s+=t;let a=r;e?.userId&&(a+=`user_${e.userId}_`),o&&(a+=`${o}_`),a+=n;let d=r;return e?.userId&&(d+=`user_${e.userId}_`),o&&(d+=`${o}_`),{keyCookieName:s,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})();