Preventing duplicate session writes during Passport.js authentication retries
When implementing custom retry logic for authentication in a Passport.js environment, the authenticate middleware is often re-invoked after an initial failure. While Passport typically writes user data to the session store only upon successful verification, the interaction between retry loops and session store idempotency is not explicitly defined in the cor