payload
Version:
Node, React, Headless CMS and Application Framework built on Next.js
17 lines (16 loc) • 500 B
JavaScript
export const resetLoginAttempts = async ({ collection, doc, payload, req })=>{
if (!('lockUntil' in doc && typeof doc.lockUntil === 'string') && (!('loginAttempts' in doc) || doc.loginAttempts === 0)) {
return;
}
await payload.db.updateOne({
id: doc.id,
collection: collection.slug,
data: {
lockUntil: null,
loginAttempts: 0
},
req,
returning: false
});
};
//# sourceMappingURL=resetLoginAttempts.js.map