From 0edd9950a759d4df535a838eafb49683ab302227 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Mon, 1 Jan 2018 17:19:48 -0600 Subject: [PATCH] fix 500 that could occur on log out --- app/controllers/application_controller.rb | 2 +- app/controllers/users_controller.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index b3d66ccc..79da1c76 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -2,7 +2,7 @@ class ApplicationController < ActionController::Base protect_from_forgery before_action do - if params[:universe].present? + if params[:universe].present? && user_signed_in? if params[:universe] == 'all' session.delete(:universe_id) elsif params[:universe].is_a?(String) && params[:universe].to_i.to_s == params[:universe] diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 67b308df..84e17cac 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -15,6 +15,7 @@ class UsersController < ApplicationController }) if Rails.env.production? end + #todo use the new constants here [ :characters, :locations, :items, :creatures, :races, :religions, :groups, :magics, :languages, :floras, :scenes, :countries, :towns, :landmarks, :universes ].each do |content_type_name|