Sha256: 27be01af19d48ff418413a17efe5ac88fa87aefea9aa1d9cfd79f1510e3760fc

Contents?: true

Size: 387 Bytes

Versions: 24

Compression:

Stored size: 387 Bytes

Contents

module RedirectIfAuthenticated
  extend ActiveSupport::Concern

  included do
    before_action :redirect_if_authenticated!
  end

  class_methods do
    def skip_redirect_if_authenticated(**options)
      skip_before_action :redirect_if_authenticated!, **options
    end
  end

  private

  def redirect_if_authenticated!
    redirect_to dashboard_path if Current.auth.check?
  end
end

Version data entries

24 entries across 12 versions & 1 rubygems

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