Skip to content

fix(server): remove duplicate passwordAttemptLimiter declaration in rateLimiter.js#222

Open
Git-Shubham14 wants to merge 1 commit into
imanchalsingh:mainfrom
Git-Shubham14:fix/duplicate-passwordattemptlimiter
Open

fix(server): remove duplicate passwordAttemptLimiter declaration in rateLimiter.js#222
Git-Shubham14 wants to merge 1 commit into
imanchalsingh:mainfrom
Git-Shubham14:fix/duplicate-passwordattemptlimiter

Conversation

@Git-Shubham14

Copy link
Copy Markdown
Contributor

Description

Fixes #215

server/middleware/rateLimiter.js declared passwordAttemptLimiter twice using export const, causing a SyntaxError: Identifier 'passwordAttemptLimiter' has already been declared crash on every server startup.

Root Cause

  • Line 45: export const passwordAttemptLimiter = rateLimit({...}) — correct declaration
  • Line 57: export const passwordAttemptLimiter = rateLimit({...}) — identical duplicate, accidentally added

JavaScript ESM does not allow two const declarations with the same name in the same scope.

Changes

  • server/middleware/rateLimiter.js — removed the second identical duplicate declaration of passwordAttemptLimiter at lines 57-68

Type of Change

  • Bug fix

Checklist

  • Code follows project style
  • Tested locally — server starts without errors after fix
  • Updated documentation

@netlify

netlify Bot commented Jul 10, 2026

Copy link
Copy Markdown

👷 Deploy request for file-sharingsystem pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit d3eaddc

@vercel

vercel Bot commented Jul 10, 2026

Copy link
Copy Markdown

@Git-Shubham14 is attempting to deploy a commit to the imanchalsingh Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added SSoC26 Official label of org bug Something isn't working backend labels Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend bug Something isn't working SSoC26 Official label of org

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Duplicate passwordAttemptLimiter declaration in rateLimiter.js crashes server

1 participant