Sha256: fd90a24632f98b13af5eb3919290c65b86a7e7d44b7e5022deda5622236a1483

Contents?: true

Size: 506 Bytes

Versions: 26

Compression:

Stored size: 506 Bytes

Contents

class SessionsController < ApplicationController

  def new
  end

  def create
    @user = User.find_by_name(params[:session][:name])
    if @user && @user.authenticate(params[:session][:password])
      sign_in(@user, permanent: params[:session][:remember_me] == "1")
      redirect_to articles_path, success: "Signed in"
    else
      flash.now[:error] = "Incorrect user/password"
      render 'new'
    end
  end

  def destroy
    sign_out
    redirect_to root_path, success: "Signed out"
  end

end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
adeia-0.10.0 spec/test_app/app/controllers/sessions_controller.rb
adeia-0.9.2 spec/test_app/app/controllers/sessions_controller.rb
adeia-0.9.1 spec/test_app/app/controllers/sessions_controller.rb
adeia-0.9.0 spec/test_app/app/controllers/sessions_controller.rb
adeia-0.8.6 spec/test_app/app/controllers/sessions_controller.rb
adeia-0.8.5 spec/test_app/app/controllers/sessions_controller.rb
adeia-0.8.4 spec/test_app/app/controllers/sessions_controller.rb
adeia-0.8.3 spec/test_app/app/controllers/sessions_controller.rb
adeia-0.8.2 spec/test_app/app/controllers/sessions_controller.rb
adeia-0.8.1 spec/test_app/app/controllers/sessions_controller.rb
adeia-0.8.0 spec/test_app/app/controllers/sessions_controller.rb
adeia-0.7.1 spec/test_app/app/controllers/sessions_controller.rb
adeia-0.7.0 spec/test_app/app/controllers/sessions_controller.rb
adeia-0.6.2 spec/test_app/app/controllers/sessions_controller.rb
adeia-0.6.1 spec/test_app/app/controllers/sessions_controller.rb
adeia-0.6.0 spec/test_app/app/controllers/sessions_controller.rb
adeia-0.5.6 spec/test_app/app/controllers/sessions_controller.rb
adeia-0.5.5 spec/test_app/app/controllers/sessions_controller.rb
adeia-0.5.4 spec/test_app/app/controllers/sessions_controller.rb
adeia-0.5.3 spec/test_app/app/controllers/sessions_controller.rb