mirror of
https://github.com/docusealco/docuseal
synced 2026-11-04 14:42:32 -05:00
add rate limit
This commit is contained in:
1 parent
265b668cb4
commit
749722a9df
4 files changed
+33
No files matched your search
@@ -19,6 +19,12 @@ module Api
|
||||
render json: { error: e.message }, status: :unprocessable_entity
|
||||
end
|
||||
|
||||
rescue_from RateLimit::LimitApproached do |e|
|
||||
Rollbar.error(e) if defined?(Rollbar)
|
||||
|
||||
render json: { error: 'Too many requests' }, status: :too_many_requests
|
||||
end
|
||||
|
||||
if Rails.env.production?
|
||||
rescue_from CanCan::AccessDenied do |e|
|
||||
Rollbar.warning(e) if defined?(Rollbar)
|
||||
|
||||
Reference in new issue
Block a user