Sha256: ccc1e801289fe31e876d2197eec5772bafc127229af689e6cb0c0a92f2254fc1

Contents?: true

Size: 519 Bytes

Versions: 3

Compression:

Stored size: 519 Bytes

Contents

class Manifest::SessionsController < Manifest::ManifestController
  layout 'manifest/sessions'

  def new
  end

  def create
    editor = Editor.find_by_email(params[:email])

    if editor && editor.authenticate(params[:password])
      session[:editor_id] = editor.id
      redirect_to manifest_path, notice: 'Logged in!'
    else
      flash.now.alert = 'Email or password is invalid'
      render 'new'
    end
  end

  def destroy
    session[:editor_id] = nil
    redirect_to new_manifest_session_path
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
manifest-rails-0.0.4 app/controllers/manifest/sessions_controller.rb
manifest-rails-0.0.3 app/controllers/manifest/sessions_controller.rb
manifest-rails-0.0.2 app/controllers/manifest/sessions_controller.rb