Sha256: 26234dfc8f1d388da018398a1ec04643173479232132efb748c6a27d52b11e4d

Contents?: true

Size: 402 Bytes

Versions: 4

Compression:

Stored size: 402 Bytes

Contents

<%- unless ModelBase.config.frozen_string_literal.nil? -%>
# frozen_string_literal: <%= ModelBase.config.frozen_string_literal.inspect %>
<%- end -%>
module Authentication
  def self.included(klass)
    klass.class_eval do
      before_action :authenticate_user!
      around_action :assign_current_user
    end
  end

  def assign_current_user(&block)
    User.current(current_user, &block)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
model_base_generators-0.4.0 lib/generators/model_base/templates/app/controllers/concerns/authentication.rb
model_base_generators-0.3.9 lib/generators/model_base/templates/app/controllers/concerns/authentication.rb
model_base_generators-0.3.8 lib/generators/model_base/templates/app/controllers/concerns/authentication.rb
model_base_generators-0.3.7 lib/generators/model_base/templates/app/controllers/concerns/authentication.rb