This commit is contained in:
@@ -6,6 +6,11 @@ from my_modules.functions import get_ip, enforce_custom_limit
|
||||
|
||||
@app.errorhandler(401)
|
||||
async def handle_unauthorized(e):
|
||||
try:
|
||||
enforce_custom_limit(LIMITER, "401", limit_count=5, window_sec=1800)
|
||||
except LookupError as e:
|
||||
return await to_many_requests(e)
|
||||
|
||||
await logger.error(e)
|
||||
return redirect(url_for('auth_login.login'))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user