UNPKG

payload

Version:

Node, React, Headless CMS and Application Framework built on Next.js

18 lines (17 loc) 485 B
export const resetLoginAttempts = async ({ collection, doc, payload, req })=>{ if (!('lockUntil' in doc && typeof doc.lockUntil === 'string') || doc.loginAttempts === 0) { return; } await payload.update({ id: doc.id, collection: collection.slug, data: { lockUntil: null, loginAttempts: 0 }, depth: 0, overrideAccess: true, req }); }; //# sourceMappingURL=resetLoginAttempts.js.map