Sha256: cad2b62df81e6dfc5bbbc462da99be89435fd9af217850c99759bde1d8e630a7

Contents?: true

Size: 324 Bytes

Versions: 6

Compression:

Stored size: 324 Bytes

Contents

module Authenticate
  extend ActiveSupport::Concern

  included do
    before_action :authenticate!
  end

  class_methods do
    def skip_authenticate(**options)
      skip_before_action :authenticate!, **options
    end
  end

  private

  def authenticate!
    redirect_to login_path unless Current.auth.check?
  end
end

Version data entries

6 entries across 3 versions & 1 rubygems

Version Path
kaze-0.8.0 stubs/hotwire/app/controllers/concerns/authenticate.rb
kaze-0.8.0 stubs/inertia-common/app/controllers/concerns/authenticate.rb
kaze-0.7.0 stubs/hotwire/app/controllers/concerns/authenticate.rb
kaze-0.7.0 stubs/inertia-common/app/controllers/concerns/authenticate.rb
kaze-0.6.0 stubs/hotwire/app/controllers/concerns/authenticate.rb
kaze-0.6.0 stubs/inertia-common/app/controllers/concerns/authenticate.rb