mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-05 07:03:51 +08:00
12 lines
423 B
Ruby
12 lines
423 B
Ruby
# frozen_string_literal: true
|
|
|
|
# The base controller for all ActiveStorage controllers.
|
|
module ActiveStorage
|
|
class CustomBaseController < ApplicationController
|
|
include TokenAuthentication
|
|
include ActiveStorage::SetCurrent
|
|
|
|
prepend_before_action :authenticate_request!, if: -> { request.headers['Authorization'].present? }
|
|
skip_before_action :authenticate_user!, if: -> { current_user.present? }
|
|
end
|
|
end
|