Class: SessionsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/sessions_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



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
   @user
  if session_params[:password] == Settings.default_password
    flash[:warning] = t('terms.changeme_password')
  end
  redirect_to root_path
end

#destroyObject



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