Sha256: f9b563f48128d0fe7566308cb7758dcc5f3f27e548a7df4bae576c7a899b9c97

Contents?: true

Size: 651 Bytes

Versions: 4

Compression:

Stored size: 651 Bytes

Contents

class Monologue::Admin::SessionsController < Monologue::Admin::BaseController
  skip_before_filter :authenticate_user!
  
  def new
  end

  def create
    user = Monologue::User.find_by_email(params[:email])
    if user && user.authenticate(params[:password])
      session[:monologue_user_id] = user.id
      redirect_to admin_url, notice: t("monologue.admin.sessions.messages.logged_in")
    else
      flash.now.alert = t("monologue.admin.sessions.messages.invalid")
      render "new"
    end
  end

  def destroy
    session[:monologue_user_id] = nil
    redirect_to admin_url, notice: t("monologue.admin.sessions.messages.logged_out")
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
monologue-0.5.0 app/controllers/monologue/admin/sessions_controller.rb
monologue-0.4.1 app/controllers/monologue/admin/sessions_controller.rb
monologue-0.4.0 app/controllers/monologue/admin/sessions_controller.rb
monologue-0.3.0 app/controllers/monologue/admin/sessions_controller.rb