(()=>{var e={};e.id=482,e.ids=[482],e.modules={96330:e=>{"use strict";e.exports=require("@prisma/client")},5486:e=>{"use strict";e.exports=require("bcrypt")},10846:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},44870:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},3295:e=>{"use strict";e.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},29294:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-async-storage.external.js")},63033:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},12412:e=>{"use strict";e.exports=require("assert")},79428:e=>{"use strict";e.exports=require("buffer")},55511:e=>{"use strict";e.exports=require("crypto")},94735:e=>{"use strict";e.exports=require("events")},81630:e=>{"use strict";e.exports=require("http")},55591:e=>{"use strict";e.exports=require("https")},11723:e=>{"use strict";e.exports=require("querystring")},79551:e=>{"use strict";e.exports=require("url")},28354:e=>{"use strict";e.exports=require("util")},74075:e=>{"use strict";e.exports=require("zlib")},8609:(e,r,t)=>{"use strict";t.r(r),t.d(r,{patchFetch:()=>g,routeModule:()=>y,serverHooks:()=>v,workAsyncStorage:()=>x,workUnitAsyncStorage:()=>w});var s={};t.r(s),t.d(s,{GET:()=>f,POST:()=>m});var a=t(42706),i=t(28203),n=t(45994),o=t(39187),u=t(11587),p=t(5486),c=t.n(p),d=t(51825),l=t(34883);async function f(){try{let e=await u.A.admin.findMany();return o.NextResponse.json(e,{status:200})}catch(e){return o.NextResponse.json({error:e.message},{status:500})}}async function m(e){if(!await (0,d.getServerSession)(l.N))return o.NextResponse.json({error:"N\xe3o autorizado. Fa\xe7a login primeiro."},{status:401});try{let{username:r,email:t,password:s}=await e.json(),a=await c().hash(s,10),i=await u.A.admin.create({data:{username:r,email:t,password:a}});return o.NextResponse.json(i,{status:201})}catch(e){return o.NextResponse.json({error:e.message},{status:500})}}let y=new a.AppRouteRouteModule({definition:{kind:i.RouteKind.APP_ROUTE,page:"/api/admin/admins/route",pathname:"/api/admin/admins",filename:"route",bundlePath:"app/api/admin/admins/route"},resolvedPagePath:"C:\\Users\\guilh\\Desktop\\plataforma-empregos-NextJs-Ts\\app\\api\\admin\\admins\\route.ts",nextConfigOutput:"",userland:s}),{workAsyncStorage:x,workUnitAsyncStorage:w,serverHooks:v}=y;function g(){return(0,n.patchFetch)({workAsyncStorage:x,workUnitAsyncStorage:w})}},96487:()=>{},78335:()=>{},34883:(e,r,t)=>{"use strict";t.d(r,{N:()=>o});var s=t(96330),a=t(91642),i=t(5486);let n=new s.PrismaClient,o={providers:[(0,a.A)({name:"Credentials",credentials:{email:{label:"Email",type:"email"},password:{label:"Password",type:"password"}},async authorize(e){if(!e?.email||!e?.password)throw Error("Credenciais inv\xe1lidas.");let r=await n.admin.findUnique({where:{email:e.email}});if(!r||!await (0,i.compare)(e.password,r.password))throw Error("Credenciais inv\xe1lidas.");return{id:r.id.toString(),username:r.username,email:r.email}}})],callbacks:{jwt:async({token:e,user:r})=>(r&&(e.id=r.id,e.username=r.name,e.email=r.email),e),session:async({session:e,token:r})=>(r&&(e.user={email:r.email}),e)},pages:{signIn:"/admin/login"},secret:process.env.NEXTAUTH_SECRET,session:{strategy:"jwt"}}},11587:(e,r,t)=>{"use strict";t.d(r,{A:()=>s});let s=new(t(96330)).PrismaClient},13676:(e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0})},51825:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var s={};Object.defineProperty(r,"default",{enumerable:!0,get:function(){return i.default}});var a=t(13676);Object.keys(a).forEach(function(e){!("default"===e||"__esModule"===e||Object.prototype.hasOwnProperty.call(s,e))&&(e in r&&r[e]===a[e]||Object.defineProperty(r,e,{enumerable:!0,get:function(){return a[e]}}))});var i=function(e,r){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=n(void 0);if(t&&t.has(e))return t.get(e);var s={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&({}).hasOwnProperty.call(e,i)){var o=a?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(s,i,o):s[i]=e[i]}return s.default=e,t&&t.set(e,s),s}(t(64767));function n(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(n=function(e){return e?t:r})(e)}Object.keys(i).forEach(function(e){!("default"===e||"__esModule"===e||Object.prototype.hasOwnProperty.call(s,e))&&(e in r&&r[e]===i[e]||Object.defineProperty(r,e,{enumerable:!0,get:function(){return i[e]}}))})}};var r=require("../../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),s=r.X(0,[638,452,331],()=>t(8609));module.exports=s})();