Class: SessionsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- SessionsController
- Defined in:
- app/controllers/sessions_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 |
# File 'app/controllers/sessions_controller.rb', line 6 def create unless @user.authenticate(session_params[:password]) flash.now[:notice] = I18n.t("messages.login_failed") return render :new end sign_in @user if session_params[:password] == Settings.default_password flash[:warning] = t('terms.changeme_password') end redirect_to root_path end |
#destroy ⇒ Object
18 19 20 21 22 |
# File 'app/controllers/sessions_controller.rb', line 18 def destroy session.delete :user_name session.delete :password redirect_to new_sessions_path end |