nightmare-tech / secure_storage

Secure Storage
3 stars 11 forks source link

Added a rate limiter for the login activity #15

Open pranavs6 opened 1 month ago

pranavs6 commented 1 month ago

Used Flask-Limiter to limit the number of login attempts within a given timeframe to restrict brute force practices

nightmare-tech commented 4 weeks ago

Cool. I'll do the review ASAP.

nightmare-tech commented 4 weeks ago

When I tried to run it, it gave me an error

❯ python app.py
Traceback (most recent call last):
  File "/home/arpit/Downloads/temp/github-testing/secure_storage/app.py", line 22, in <module>
    limiter = Limiter(
              ^^^^^^^^
TypeError: Limiter.__init__() got multiple values for argument 'app'

does this happen with you?

pranavs6 commented 3 weeks ago

Hey, apologies on the late reply, having my finals going on. About the issue you're facing, it runs fine for me though, checkout the screenshot below

image

However, I would suggest you try replacing the limiter's initialization from

From:

limiter = Limiter( get_remote_address, app=app, default_limits=["200 per day", "50 per hour"] )

To:

limiter = Limiter( get_remote_address, default_limits=["200 per day", "50 per hour"] ) limiter.init_app(app)