add ratelimit

This commit is contained in:
Pete Matsyburka committed 2026-09-28 09:40:15 +03:00
1 parent a8433e9bd3
commit 218c22da21
2 files changed
+7 -2

No files matched your search

@@ -10,6 +10,8 @@ class SubmitFormEmail2fasController < ApplicationController
def create
RateLimit.call("verify-2fa-code-#{@submitter.id}", limit: 2, ttl: 45.seconds, enabled: true)
RateLimit.call("verify-2fa-code-1h-#{@submitter.id}", limit: 10, ttl: 1.hour, enabled: true)
RateLimit.call("verify-2fa-code-1d-#{@submitter.id}", limit: 20, ttl: 1.day, enabled: true)
value = [@submitter.email.downcase.strip, @submitter.slug].join(':')