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
1 line
1.4 KiB
Plaintext
1 line
1.4 KiB
Plaintext
{"version":3,"sources":["../../../../src/auth/strategies/local/resetLoginAttempts.ts"],"sourcesContent":["import type { SanitizedCollectionConfig, TypeWithID } from '../../../collections/config/types.js'\nimport type { Payload } from '../../../index.js'\nimport type { PayloadRequest } from '../../../types/index.js'\n\ntype Args = {\n collection: SanitizedCollectionConfig\n doc: Record<string, unknown> & TypeWithID\n payload: Payload\n req: PayloadRequest\n}\n\nexport const resetLoginAttempts = async ({\n collection,\n doc,\n payload,\n req,\n}: Args): Promise<void> => {\n if (\n !('lockUntil' in doc && typeof doc.lockUntil === 'string') &&\n (!('loginAttempts' in doc) || doc.loginAttempts === 0)\n ) {\n return\n }\n await payload.db.updateOne({\n id: doc.id,\n collection: collection.slug,\n data: {\n lockUntil: null,\n loginAttempts: 0,\n },\n req,\n returning: false,\n })\n}\n"],"names":["resetLoginAttempts","collection","doc","payload","req","lockUntil","loginAttempts","db","updateOne","id","slug","data","returning"],"mappings":"AAWA,OAAO,MAAMA,qBAAqB,OAAO,EACvCC,UAAU,EACVC,GAAG,EACHC,OAAO,EACPC,GAAG,EACE;IACL,IACE,CAAE,CAAA,eAAeF,OAAO,OAAOA,IAAIG,SAAS,KAAK,QAAO,KACvD,CAAA,CAAE,CAAA,mBAAmBH,GAAE,KAAMA,IAAII,aAAa,KAAK,CAAA,GACpD;QACA;IACF;IACA,MAAMH,QAAQI,EAAE,CAACC,SAAS,CAAC;QACzBC,IAAIP,IAAIO,EAAE;QACVR,YAAYA,WAAWS,IAAI;QAC3BC,MAAM;YACJN,WAAW;YACXC,eAAe;QACjB;QACAF;QACAQ,WAAW;IACb;AACF,EAAC"} |