Sha256: 6572fd56f90bdebe3ff1dee3d10a752c33f58730e55aa624a3453239992c0865

Contents?: true

Size: 661 Bytes

Versions: 9

Compression:

Stored size: 661 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

  layout 'guest'

  def new
    @form = Auth::LoginForm.new

    render 'auth/login'
  end

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

    @form.authenticate

    return render 'auth/login', status: :unprocessable_entity 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/hotwire/app/controllers/auth/authenticated_session_controller.rb
kaze-0.16.0 stubs/hotwire/app/controllers/auth/authenticated_session_controller.rb
kaze-0.15.0 stubs/hotwire/app/controllers/auth/authenticated_session_controller.rb
kaze-0.14.0 stubs/hotwire/app/controllers/auth/authenticated_session_controller.rb
kaze-0.13.0 stubs/hotwire/app/controllers/auth/authenticated_session_controller.rb
kaze-0.12.0 stubs/hotwire/app/controllers/auth/authenticated_session_controller.rb
kaze-0.11.0 stubs/hotwire/app/controllers/auth/authenticated_session_controller.rb
kaze-0.10.0 stubs/hotwire/app/controllers/auth/authenticated_session_controller.rb
kaze-0.9.0 stubs/hotwire/app/controllers/auth/authenticated_session_controller.rb