Sha256: 1b9c8928dc8f5fb31a28111ecfb16e8eb1ff0315b0e4966f206926965906f3e3

Contents?: true

Size: 504 Bytes

Versions: 34

Compression:

Stored size: 504 Bytes

Contents

class SessionsController < ApplicationController
  def new
  end

  def create
    @user = User.find_by("LOWER(email)= ?", params[:email].downcase)
    if @user && @user.authenticate(params[:password])
      session[:user_id] = @user.id
      redirect_to params[:return_to] || root_url, notice: "Logged in!"
    else
      flash[:warning] = "You have entered incorrect email and/or password."
      render :new
    end
  end

  def destroy
    session.delete(:user_id)
    redirect_to root_path
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
mobile_workflow-0.6.30 lib/generators/mobile_workflow/install/templates/sessions_controller.rb.erb
mobile_workflow-0.6.29 lib/generators/mobile_workflow/install/templates/sessions_controller.rb.erb
mobile_workflow-0.6.28 lib/generators/mobile_workflow/install/templates/sessions_controller.rb.erb
mobile_workflow-0.6.27 lib/generators/mobile_workflow/install/templates/sessions_controller.rb.erb
mobile_workflow-0.6.26 lib/generators/mobile_workflow/install/templates/sessions_controller.rb.erb
mobile_workflow-0.6.25 lib/generators/mobile_workflow/install/templates/sessions_controller.rb.erb
mobile_workflow-0.6.24 lib/generators/mobile_workflow/install/templates/sessions_controller.rb.erb
mobile_workflow-0.6.23 lib/generators/mobile_workflow/install/templates/sessions_controller.rb.erb
mobile_workflow-0.6.22 lib/generators/mobile_workflow/install/templates/sessions_controller.rb.erb
mobile_workflow-0.6.21 lib/generators/mobile_workflow/install/templates/sessions_controller.rb.erb
mobile_workflow-0.6.20 lib/generators/mobile_workflow/install/templates/sessions_controller.rb.erb
mobile_workflow-0.6.19 lib/generators/mobile_workflow/install/templates/sessions_controller.rb.erb
mobile_workflow-0.6.18 lib/generators/mobile_workflow/install/templates/sessions_controller.rb.erb
mobile_workflow-0.6.17 lib/generators/mobile_workflow/install/templates/sessions_controller.rb.erb
mobile_workflow-0.6.16 lib/generators/mobile_workflow/install/templates/sessions_controller.rb.erb
mobile_workflow-0.6.15 lib/generators/mobile_workflow/install/templates/sessions_controller.rb.erb
mobile_workflow-0.6.14 lib/generators/mobile_workflow/install/templates/sessions_controller.rb.erb
mobile_workflow-0.6.13 lib/generators/mobile_workflow/install/templates/sessions_controller.rb.erb
mobile_workflow-0.6.12 lib/generators/mobile_workflow/install/templates/sessions_controller.rb.erb
mobile_workflow-0.6.11 lib/generators/mobile_workflow/install/templates/sessions_controller.rb.erb