app/controllers/auth.rb
# Test for valid logged in user
Test for valid logged in user
Test for valid logged in user
def check_logged_in
      return if session['user_id'] && User.find_by_id(session[:user_id])
      session.clear
      flash['alert-danger'] = 'Please log in'
      redirect to '/pre_auth/login', 403
    end
def check_logged_in return if session [ 'user_id' ] && User . find_by_id ( session [ :user_id ] ) session . clear flash [ 'alert-danger' ] = 'Please log in' redirect to '/pre_auth/login' , 403 end
Test for valid logged in user
Test for valid logged in user