lock to prevent parallel logins

This commit is contained in:
x032205
2025-09-02 20:49:51 -04:00
parent 642b56fbda
commit 77d56468f1
3 changed files with 43 additions and 8 deletions
@@ -137,7 +137,7 @@ export const registerIdentityLdapAuthRouter = async (server: FastifyZodProvider)
},
preValidation: [
async (req, res) => {
await server.services.identityLdapAuth.checkLdapLockout({
const { lock } = await server.services.identityLdapAuth.checkLdapLockout({
identityId: req.body.identityId,
username: req.body.username
});
@@ -167,6 +167,8 @@ export const registerIdentityLdapAuthRouter = async (server: FastifyZodProvider)
}
throw error;
} finally {
await lock.release();
}
}
],