Sha256: 11e5606064a59b9f975bd087e52cd8a7aa11a98d8c0f742313971ce8869f2b6f

Contents?: true

Size: 422 Bytes

Versions: 20

Compression:

Stored size: 422 Bytes

Contents

class SessionsController < ApplicationController

  def new
  end

  def create
    user = User.find_by(email: params[:session][:email].downcase)
    if user && user.authenticate(params[:session][:password])
      sign_in user
      redirect_back_or user
    else
      flash.now[:error] = 'Invalid email/password combination'
      render 'new'
    end
  end

  def destroy
    sign_out
    redirect_to root_url
  end
end

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
rails_magic_renamer-2.0.0.pre.alpha spec/support/sample_app_rails_4/app/controllers/sessions_controller.rb
active_mocker-1.4.2 sample_app_rails_4/app/controllers/sessions_controller.rb
active_mocker-1.4.1 sample_app_rails_4/app/controllers/sessions_controller.rb
active_mocker-1.3.2 sample_app_rails_4/app/controllers/sessions_controller.rb
active_mocker-1.3.1 sample_app_rails_4/app/controllers/sessions_controller.rb
active_mocker-1.3 sample_app_rails_4/app/controllers/sessions_controller.rb
active_mocker-1.2.4 sample_app_rails_4/app/controllers/sessions_controller.rb
active_mocker-1.2.3 sample_app_rails_4/app/controllers/sessions_controller.rb
active_mocker-1.2 sample_app_rails_4/app/controllers/sessions_controller.rb
active_mocker-1.2.pre.11 sample_app_rails_4/app/controllers/sessions_controller.rb
active_mocker-1.2.pre.10 sample_app_rails_4/app/controllers/sessions_controller.rb
active_mocker-1.2.pre.9 sample_app_rails_4/app/controllers/sessions_controller.rb
active_mocker-1.2.pre.8 sample_app_rails_4/app/controllers/sessions_controller.rb
active_mocker-1.2.pre.7 sample_app_rails_4/app/controllers/sessions_controller.rb
active_mocker-1.2.pre.6 sample_app_rails_4/app/controllers/sessions_controller.rb
active_mocker-1.2.pre.5 sample_app_rails_4/app/controllers/sessions_controller.rb
active_mocker-1.2.pre.4 sample_app_rails_4/app/controllers/sessions_controller.rb
active_mocker-1.2.pre.3 sample_app_rails_4/app/controllers/sessions_controller.rb
active_mocker-1.2.pre.2 sample_app_rails_4/app/controllers/sessions_controller.rb
active_mocker-1.2.pre.1 sample_app_rails_4/app/controllers/sessions_controller.rb