Best practices for OTP-based login & downloading files? #255
-
I have created a Next.js project with simple API routes 🤜 https://github.com/deadcoder0904/nextjs-rate-limit But I have doubts on the request & points I'm using. So would love to know what are the best practices on these routes. Not expecting to get rate limited but if I do, would love some simple parameters. Only have 2 different routes that matter:
I made this small project to mimic my real-world scenario. Would definitely love to know what should I put in those numbers? I have read the Wiki examples & tried making the complex scenarios but I think it is premature optimization for my early-stage product so just need something simple yet effective.
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
|
Beta Was this translation helpful? Give feedback.
-
@deadcoder0904 Could you provide an example of Next.js code? I would add to Wiki to a separate page. |
Beta Was this translation helpful? Give feedback.
@deadcoder0904 Hi
Download a file
endpoint, you should analyze your files. There is no best practice, but understanding what your server should and can handle if somebody tries to DDoS it with many file downloads. You can also limit by the total size of files user can download per hour/day.