This commit is contained in:
2025-05-30 01:21:30 +09:00
parent e8e18160bc
commit f93cea4e51
8 changed files with 85 additions and 8 deletions
@@ -1,2 +1,16 @@
class ApplicationController < ActionController::API
before_action :authenticate_user
def current_user
@current_user
end
private
def authenticate_user
code = request.headers['X-Transfer-Code'] || request.headers['HTTP_X_TRANSFER_CODE']
@current_user = User.find_by inheritance_code: code
Rails.logger.info("X-Transfer-Code: #{request.headers['X-Transfer-Code']}")
Rails.logger.info("current_user: #{@current_user&.id}")
end
end