Sha256: b1b89115485fdbe7251f264226f481d546af2f5ee554222ae98cae65de97d95e

Contents?: true

Size: 541 Bytes

Versions: 37

Compression:

Stored size: 541 Bytes

Contents

module Brightcontent
  class SessionsController < ApplicationController
    skip_before_filter :authorize

    def new
    end

    def create
      user = AdminUser.find_by_email(params[:email])
      if user && user.authenticate(params[:password])
        session[:brightcontent_user_id] = user.id
        redirect_to root_url
      else
        flash.now.alert = "Email or password is invalid"
        render :new
      end
    end

    def destroy
      session[:brightcontent_user_id] = nil
      redirect_to root_url
    end
  end
end

Version data entries

37 entries across 37 versions & 2 rubygems

Version Path
brightcontent-core-2.0.33 app/controllers/brightcontent/sessions_controller.rb
brightcontent-core-2.0.31 app/controllers/brightcontent/sessions_controller.rb
brightcontent-core-2.0.30 app/controllers/brightcontent/sessions_controller.rb
brightcontent-core-2.0.29 app/controllers/brightcontent/sessions_controller.rb
brightcontent-core-2.0.28 app/controllers/brightcontent/sessions_controller.rb
brightcontent-core-2.0.27 app/controllers/brightcontent/sessions_controller.rb
brightcontent-core-2.0.26 app/controllers/brightcontent/sessions_controller.rb
brightcontent-core-2.0.25 app/controllers/brightcontent/sessions_controller.rb
brightcontent-core-2.0.24 app/controllers/brightcontent/sessions_controller.rb
brightcontent-core-2.0.23 app/controllers/brightcontent/sessions_controller.rb
brightcontent-core-2.0.22 app/controllers/brightcontent/sessions_controller.rb
brightcontent-core-2.0.21 app/controllers/brightcontent/sessions_controller.rb
brightcontent-core-2.0.20 app/controllers/brightcontent/sessions_controller.rb
brightcontent-core-2.0.19 app/controllers/brightcontent/sessions_controller.rb
brightcontent-core-2.0.18 app/controllers/brightcontent/sessions_controller.rb
brightcontent-core-2.0.17 app/controllers/brightcontent/sessions_controller.rb
brightcontent-core-2.0.16 app/controllers/brightcontent/sessions_controller.rb
brightcontent-core-2.0.15 app/controllers/brightcontent/sessions_controller.rb
brightcontent-core-2.0.14 app/controllers/brightcontent/sessions_controller.rb
brightcontent-core-2.0.13 app/controllers/brightcontent/sessions_controller.rb