sausage-sandwich/ruby_sandwich

View on GitHub
apps/web/controllers/profile/authentication.rb

Summary

Maintainability
A
0 mins
Test Coverage
# frozen_string_literal: true

module Web
  module Controllers
    module Profile
      module Authentication
        def self.included(action)
          action.class_eval do
            before :authenticate!
          end
        end

        private

        def authenticate!
          redirect_to routes.new_session_path unless current_user
        end
      end
    end
  end
end