Files
klz-cables.com/.pnpm-store/v10/files/0e/a6f04c85ecd26fa27eab58e8719a5f84760114d107a2f1de7355285618b57a3c7ffde5724a8915a19eced7a49c92ff78aa764321af4067c2d08a27a083a1a6
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

1 line
3.3 KiB
Plaintext

{"version":3,"sources":["../../../src/auth/endpoints/registerFirstUser.ts"],"sourcesContent":["import { status as httpStatus } from 'http-status'\n\nimport type { PayloadHandler } from '../../config/types.js'\n\nimport { getRequestCollection } from '../../utilities/getRequestEntity.js'\nimport { headersWithCors } from '../../utilities/headersWithCors.js'\nimport { generatePayloadCookie } from '../cookies.js'\nimport { registerFirstUserOperation } from '../operations/registerFirstUser.js'\n\nexport const registerFirstUserHandler: PayloadHandler = async (req) => {\n const collection = getRequestCollection(req)\n const { data, t } = req\n const authData = collection.config.auth?.loginWithUsername\n ? {\n email: typeof req.data?.email === 'string' ? req.data.email : '',\n password: typeof req.data?.password === 'string' ? req.data.password : '',\n username: typeof req.data?.username === 'string' ? req.data.username : '',\n }\n : {\n email: typeof req.data?.email === 'string' ? req.data.email : '',\n password: typeof req.data?.password === 'string' ? req.data.password : '',\n }\n\n const result = await registerFirstUserOperation({\n collection,\n data: {\n ...data,\n ...authData,\n },\n req,\n })\n\n const cookie = generatePayloadCookie({\n collectionAuthConfig: collection.config.auth,\n cookiePrefix: req.payload.config.cookiePrefix,\n token: result.token!,\n })\n\n return Response.json(\n {\n exp: result.exp,\n message: t('authentication:successfullyRegisteredFirstUser'),\n token: result.token,\n user: result.user,\n },\n {\n headers: headersWithCors({\n headers: new Headers({\n 'Set-Cookie': cookie,\n }),\n req,\n }),\n status: httpStatus.OK,\n },\n )\n}\n"],"names":["status","httpStatus","getRequestCollection","headersWithCors","generatePayloadCookie","registerFirstUserOperation","registerFirstUserHandler","req","collection","data","t","authData","config","auth","loginWithUsername","email","password","username","result","cookie","collectionAuthConfig","cookiePrefix","payload","token","Response","json","exp","message","user","headers","Headers","OK"],"mappings":"AAAA,SAASA,UAAUC,UAAU,QAAQ,cAAa;AAIlD,SAASC,oBAAoB,QAAQ,sCAAqC;AAC1E,SAASC,eAAe,QAAQ,qCAAoC;AACpE,SAASC,qBAAqB,QAAQ,gBAAe;AACrD,SAASC,0BAA0B,QAAQ,qCAAoC;AAE/E,OAAO,MAAMC,2BAA2C,OAAOC;IAC7D,MAAMC,aAAaN,qBAAqBK;IACxC,MAAM,EAAEE,IAAI,EAAEC,CAAC,EAAE,GAAGH;IACpB,MAAMI,WAAWH,WAAWI,MAAM,CAACC,IAAI,EAAEC,oBACrC;QACEC,OAAO,OAAOR,IAAIE,IAAI,EAAEM,UAAU,WAAWR,IAAIE,IAAI,CAACM,KAAK,GAAG;QAC9DC,UAAU,OAAOT,IAAIE,IAAI,EAAEO,aAAa,WAAWT,IAAIE,IAAI,CAACO,QAAQ,GAAG;QACvEC,UAAU,OAAOV,IAAIE,IAAI,EAAEQ,aAAa,WAAWV,IAAIE,IAAI,CAACQ,QAAQ,GAAG;IACzE,IACA;QACEF,OAAO,OAAOR,IAAIE,IAAI,EAAEM,UAAU,WAAWR,IAAIE,IAAI,CAACM,KAAK,GAAG;QAC9DC,UAAU,OAAOT,IAAIE,IAAI,EAAEO,aAAa,WAAWT,IAAIE,IAAI,CAACO,QAAQ,GAAG;IACzE;IAEJ,MAAME,SAAS,MAAMb,2BAA2B;QAC9CG;QACAC,MAAM;YACJ,GAAGA,IAAI;YACP,GAAGE,QAAQ;QACb;QACAJ;IACF;IAEA,MAAMY,SAASf,sBAAsB;QACnCgB,sBAA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