Sha256: 2e4a9d8feac20c84fb7ade6667fc9c7d3fb0d24f87a9b2e5cf70f307826b4aa8

Contents?: true

Size: 603 Bytes

Versions: 2

Compression:

Stored size: 603 Bytes

Contents

module Adminpanel
	class SessionsController < Adminpanel::ApplicationController

		layout "login"
		layout 'sessions'
		skip_before_filter :signed_in_user

		def new
		end

		def create
			user = User.find_by_email(params[:session][:email].downcase)
			if user && user.authenticate(params[:session][:password])
					sign_in user
					flash[:success] = t("authentication.signin success")
					redirect_to root_url
			else
				flash.now[:error] = t("authentication.signin error")
				render 'new'
			end
		end

		def destroy
			sign_out
			redirect_to signin_path
		end
	end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
adminpanel-0.0.6.1 app/controllers/adminpanel/sessions_controller.rb
adminpanel-0.0.6 app/controllers/adminpanel/sessions_controller.rb