Sha256: b496bd600188b419018eee8bcde1fadb59f8095208646941bcce5005e7d3a553

Contents?: true

Size: 684 Bytes

Versions: 9

Compression:

Stored size: 684 Bytes

Contents

class Auth::AuthenticatedSessionController < ApplicationController
  include RedirectIfAuthenticated

  skip_authenticate only: %i[new create]
  skip_redirect_if_authenticated only: :destroy
  skip_ensure_email_is_verified only: :destroy

  def new
    render inertia: 'Auth/Login', props: {
      status: flash[:status]
    }
  end

  def create
    form = Auth::LoginForm.new(params.permit(:email, :password, :remember))

    form.authenticate

    return redirect_back_or_to login_path, inertia: { errors: form.error_messages } if Current.auth.user.nil?

    redirect_to dashboard_path
  end

  def destroy
    Current.auth.logout

    reset_session

    redirect_to '/'
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
kaze-0.17.0 stubs/inertia-common/app/controllers/auth/authenticated_session_controller.rb
kaze-0.16.0 stubs/inertia-common/app/controllers/auth/authenticated_session_controller.rb
kaze-0.15.0 stubs/inertia-common/app/controllers/auth/authenticated_session_controller.rb
kaze-0.14.0 stubs/inertia-common/app/controllers/auth/authenticated_session_controller.rb
kaze-0.13.0 stubs/inertia-common/app/controllers/auth/authenticated_session_controller.rb
kaze-0.12.0 stubs/inertia-common/app/controllers/auth/authenticated_session_controller.rb
kaze-0.11.0 stubs/inertia-common/app/controllers/auth/authenticated_session_controller.rb
kaze-0.10.0 stubs/inertia-common/app/controllers/auth/authenticated_session_controller.rb
kaze-0.9.0 stubs/inertia-common/app/controllers/auth/authenticated_session_controller.rb