mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-15 02:31:42 +00:00
autenticar la subida de archivos
activestorage permite subida de archivos sin autenticación!
This commit is contained in:
parent
56b4884b32
commit
3bcdc5a00f
2 changed files with 13 additions and 0 deletions
|
@ -0,0 +1,11 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
module ActiveStorage
|
||||||
|
module AuthenticatedDirectUploadsController
|
||||||
|
extend ActiveSupport::Concern
|
||||||
|
|
||||||
|
included do
|
||||||
|
before_action :authenticate_usuarie!
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -39,6 +39,8 @@ module Sutty
|
||||||
config.active_storage.variant_processor = :vips
|
config.active_storage.variant_processor = :vips
|
||||||
|
|
||||||
config.after_initialize do
|
config.after_initialize do
|
||||||
|
ActiveStorage::DirectUploadsController.include ActiveStorage::AuthenticatedDirectUploadsController
|
||||||
|
|
||||||
I18n.available_locales.each do |locale|
|
I18n.available_locales.each do |locale|
|
||||||
translations = I18n.t(:email_address, locale: locale)
|
translations = I18n.t(:email_address, locale: locale)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue