From ff4d6a405a0d8889f83cf89c71d0e140add9a8ae Mon Sep 17 00:00:00 2001 From: Jeremy Zhang Date: Wed, 20 Sep 2017 07:07:55 +0000 Subject: [PATCH] Change guest ratelimits to create 3 times per 30mins and lower time to change username to 10mins --- webapp/titanembeds/blueprints/api/api.py | 4 ++-- webapp/titanembeds/static/js/embed.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/webapp/titanembeds/blueprints/api/api.py b/webapp/titanembeds/blueprints/api/api.py index 5439061..d43c839 100644 --- a/webapp/titanembeds/blueprints/api/api.py +++ b/webapp/titanembeds/blueprints/api/api.py @@ -271,7 +271,7 @@ def post(): return response @api.route("/create_unauthenticated_user", methods=["POST"]) -@rate_limiter.limit("1 per 15 minute", key_func=guild_ratelimit_key) +@rate_limiter.limit("3 per 30 minute", key_func=guild_ratelimit_key) def create_unauthenticated_user(): session['unauthenticated'] = True username = request.form['username'] @@ -307,7 +307,7 @@ def create_unauthenticated_user(): return response @api.route("/change_unauthenticated_username", methods=["POST"]) -@rate_limiter.limit("1 per 15 minute", key_func=guild_ratelimit_key) +@rate_limiter.limit("1 per 10 minute", key_func=guild_ratelimit_key) def change_unauthenticated_username(): username = request.form['username'] guild_id = request.form['guild_id'] diff --git a/webapp/titanembeds/static/js/embed.js b/webapp/titanembeds/static/js/embed.js index ac1b6ff..68e2457 100644 --- a/webapp/titanembeds/static/js/embed.js +++ b/webapp/titanembeds/static/js/embed.js @@ -964,7 +964,7 @@ }); usr.fail(function(data) { if (data.status == 429) { - Materialize.toast('Sorry! You are allowed to log in as a guest once every 15 minutes.', 10000); + Materialize.toast('Sorry! You are allowed to log in as a guest three times in a span of 30 minutes.', 10000); } else if (data.status == 403) { Materialize.toast('Authentication error! You have been banned.', 10000); } else if (data.status == 406) { @@ -997,7 +997,7 @@ }); usr.fail(function(data) { if (data.status == 429) { - Materialize.toast('Sorry! You are allowed to change your username once every 15 minutes.', 10000); + Materialize.toast('Sorry! You are allowed to change your username once every 10 minutes.', 10000); } else if (data.status == 403) { Materialize.toast('Authentication error! You have been banned.', 10000); } else if (data.status == 406) {