autenticar la subida de archivos

activestorage permite subida de archivos sin autenticación!
This commit is contained in:
f 2021-02-28 11:00:48 -03:00
parent 56b4884b32
commit 3bcdc5a00f
2 changed files with 13 additions and 0 deletions

View file

@ -0,0 +1,11 @@
# frozen_string_literal: true
module ActiveStorage
module AuthenticatedDirectUploadsController
extend ActiveSupport::Concern
included do
before_action :authenticate_usuarie!
end
end
end

View file

@ -39,6 +39,8 @@ module Sutty
config.active_storage.variant_processor = :vips
config.after_initialize do
ActiveStorage::DirectUploadsController.include ActiveStorage::AuthenticatedDirectUploadsController
I18n.available_locales.each do |locale|
translations = I18n.t(:email_address, locale: locale)