app/controllers/adminpanel/sessions_controller.rb in adminpanel-0.1.1 vs app/controllers/adminpanel/sessions_controller.rb in adminpanel-1.0.0
- old
+ new
@@ -1,27 +1,27 @@
-module Adminpanel
- class SessionsController < Adminpanel::ApplicationController
-
- layout "admin-login"
- 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
+module Adminpanel
+ class SessionsController < Adminpanel::ApplicationController
+
+ layout "admin-login"
+ skip_before_filter :signed_in_user, :set_model
+
+ 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
\ No newline at end of file