Sha256: 099a9038d047f7bd80a151c83bbb3381a6ba00b2230de341a9546b671e2363b3

Contents?: true

Size: 398 Bytes

Versions: 12

Compression:

Stored size: 398 Bytes

Contents

class SessionsController < ApplicationController
  def new; end

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

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
mobile_workflow-0.12.2 lib/generators/mobile_workflow/install/templates/sessions_controller.rb.erb
mobile_workflow-0.12.1 lib/generators/mobile_workflow/install/templates/sessions_controller.rb.erb
mobile_workflow-0.12.0 lib/generators/mobile_workflow/install/templates/sessions_controller.rb.erb
mobile_workflow-0.11.1 lib/generators/mobile_workflow/install/templates/sessions_controller.rb.erb
mobile_workflow-0.11.0 lib/generators/mobile_workflow/install/templates/sessions_controller.rb.erb
mobile_workflow-0.10.2 lib/generators/mobile_workflow/install/templates/sessions_controller.rb.erb
mobile_workflow-0.10.1 lib/generators/mobile_workflow/install/templates/sessions_controller.rb.erb
mobile_workflow-0.10.0 lib/generators/mobile_workflow/install/templates/sessions_controller.rb.erb
mobile_workflow-0.9.0 lib/generators/mobile_workflow/install/templates/sessions_controller.rb.erb
mobile_workflow-0.8.9 lib/generators/mobile_workflow/install/templates/sessions_controller.rb.erb
mobile_workflow-0.7.9 lib/generators/mobile_workflow/install/templates/sessions_controller.rb.erb
mobile_workflow-0.7.8 lib/generators/mobile_workflow/install/templates/sessions_controller.rb.erb