app/controllers/application_controller.rb
def authenticate_user
    if Settings.configuration_finished
      unless Settings.authenticate(session[:password])
        session[:password] = nil
        redirect_to new_session_path
        false
      end
    else
      redirect_to new_setting_path
    end
  end
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
Prevent CSRF attacks by raising an exception.
For APIs, you may want to use :null_session instead.
Prevent CSRF attacks by raising an exception . For APIs you may want to use : null_session instead .
def authenticate_user
    if Settings.configuration_finished
      unless Settings.authenticate(session[:password])
        session[:password] = nil
        redirect_to new_session_path
        false
      end
    else
      redirect_to new_setting_path
    end
  end
def authenticate_user if Settings . configuration_finished unless Settings . authenticate ( session [ :password ] ) session [ :password ] = nil redirect_to new_session_path false end else redirect_to new_setting_path end end
Prevent CSRF attacks by raising an exception.
Prevent CSRF attacks by raising an exception .