Files
dsql-admin/dsql-app/.local_dist/server/pages/api/social-login/utils/getEmailFromSocialId.js
T
2025-01-13 09:00:21 +01:00

1 line
1.7 KiB
JavaScript

"use strict";(()=>{var e={};e.id=3589,e.ids=[3589],e.modules={75600:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},96762:(e,t)=>{Object.defineProperty(t,"M",{enumerable:!0,get:function(){return function e(t,n){return n in t?t[n]:"then"in t&&"function"==typeof t.then?t.then(t=>e(t,n)):"function"==typeof t&&"default"===n?t:void 0}}})},74059:(e,t,n)=>{n.r(t),n.d(t,{config:()=>d,default:()=>s,routeModule:()=>c});var r={};n.r(r),n.d(r,{default:()=>u});var i=n(89947),o=n(2706),a=n(96762),l=n(48786);async function u(e,t){if("GET"!==e.method)return t.json({msg:"Failed!"});let{social_id:n,social_platform:r}=e.query,i=await (0,l.A)("SELECT email FROM users WHERE social_id=? AND social_platform=?",[n,r]);i&&i[0]?t.json({email:i[0].email}):t.json({email:null})}let s=(0,a.M)(r,"default"),d=(0,a.M)(r,"config"),c=new i.PagesAPIRouteModule({definition:{kind:o.A.PAGES_API,page:"/api/social-login/utils/getEmailFromSocialId",pathname:"/api/social-login/utils/getEmailFromSocialId",bundlePath:"",filename:""},userland:r})},48786:(e,t,n)=>{n.d(t,{A:()=>r});async function r(...e){let t=global.DSQL_DB_CONN;try{if(!t)throw Error("No Connection provided to DB_HANDLER function!");let n=await t.query(...e);return JSON.parse(JSON.stringify(n))}catch(e){return console.log("DB Error =>",e),{success:!1,error:e.message}}finally{await t?.end()}}},2706:(e,t)=>{Object.defineProperty(t,"A",{enumerable:!0,get:function(){return n}});var n=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,t,n)=>{e.exports=n(75600)}};var t=require("../../../../webpack-api-runtime.js");t.C(e);var n=t(t.s=74059);module.exports=n})();