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.10 lib/generators/mobile_workflow/install/templates/sessions_controller.rb.erb
mobile_workflow-0.6.9 lib/generators/mobile_workflow/install/templates/sessions_controller.rb.erb
mobile_workflow-0.6.8 lib/generators/mobile_workflow/install/templates/sessions_controller.rb.erb
mobile_workflow-0.6.7 lib/generators/mobile_workflow/install/templates/sessions_controller.rb.erb
mobile_workflow-0.6.6 lib/generators/mobile_workflow/install/templates/sessions_controller.rb.erb
mobile_workflow-0.6.4 lib/generators/mobile_workflow/install/templates/sessions_controller.rb.erb
mobile_workflow-0.6.3 lib/generators/mobile_workflow/install/templates/sessions_controller.rb.erb
mobile_workflow-0.6.2 lib/generators/mobile_workflow/install/templates/sessions_controller.rb.erb
mobile_workflow-0.6.1 lib/generators/mobile_workflow/install/templates/sessions_controller.rb.erb
mobile_workflow-0.6.0 lib/generators/mobile_workflow/install/templates/sessions_controller.rb.erb
mobile_workflow-0.5.11 lib/generators/mobile_workflow/install/templates/sessions_controller.rb.erb
mobile_workflow-0.5.10 lib/generators/mobile_workflow/install/templates/sessions_controller.rb.erb
mobile_workflow-0.5.9 lib/generators/mobile_workflow/install/templates/sessions_controller.rb.erb
mobile_workflow-0.5.8 lib/generators/mobile_workflow/install/templates/sessions_controller.rb.erb