Sha256: d765f271f640c01b457d7e501f9e89279ca8041aec32691390cb10edad699faf

Contents?: true

Size: 419 Bytes

Versions: 1

Compression:

Stored size: 419 Bytes

Contents

class SigninController < ApplicationController
  def signin
  end

  def submit_signin
    user = User.find_by(email: params[:email])
    if user && user.authenticate(params[:password])
      sign_in user
      redirect_to :admin_home
    else
      flash[:error] = 'Login failed. Please try again.'
      redirect_to :signin
    end
  end

  def signout
    session.delete :user_id
    redirect_to :signin
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
distribot-ui-0.1.0 app/controllers/signin_controller.rb