Sha256: 7ddaaae3cedd079c44b8d902417071dde7db60273271139fe38a433f3170e532

Contents?: true

Size: 506 Bytes

Versions: 2

Compression:

Stored size: 506 Bytes

Contents

class Auth::AuthenticatedSessionController < ApplicationController
  skip_authentication only: %i[new create]

  layout "guest"

  def new
    @form = Auth::LoginForm.new

    render "auth/login"
  end

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

    user = @form.authenticate

    return render "auth/login", status: :unprocessable_entity if user.nil?

    login user

    redirect_to dashboard_path
  end

  def destroy
    logout

    redirect_to login_path
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
kaze-0.4.0 stubs/hotwire/app/controllers/auth/authenticated_session_controller.rb
kaze-0.3.0 stubs/hotwire/app/controllers/auth/authenticated_session_controller.rb