budget/app/controllers/concerns/authenticatable.rb

14 lines
239 B
Ruby
Raw Normal View History

2024-08-16 19:21:44 -04:00
module Authenticatable
extend ActiveSupport::Concern
included do
before_action :authenticate_user
end
private
def authenticate_user
2024-08-16 19:53:02 -04:00
Current.user = User.find_by(id: session[:current_user_id]) || GuestUser.new
2024-08-16 19:21:44 -04:00
end
end