about summary refs log tree commit diff
path: root/app/controllers/home_controller.rb
diff options
context:
space:
mode:
authorMarcin Cieślak <saper@saper.info>2017-04-15 16:46:27 +0200
committerEugen <eugen@zeonfederated.com>2017-04-15 16:46:27 +0200
commit1c8477eab214629d26d9526b386bf75729917060 (patch)
treea937c60129fa9ee947c3af7b136a903bd4555c76 /app/controllers/home_controller.rb
parent6670e6d33fa735b6199e3b962f62ed6d1442bae1 (diff)
Give SINGLE_USER a chance to register (#1820)
An attempt to open a brand new Mastodon instance configured
as SINGLE_USER_MODE=true will cause an exception.

Enable temporary registration if we have no users in the database

Fixes #1817
Diffstat (limited to 'app/controllers/home_controller.rb')
-rw-r--r--app/controllers/home_controller.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb
index 65ac10692..2d1cf74f0 100644
--- a/app/controllers/home_controller.rb
+++ b/app/controllers/home_controller.rb
@@ -13,7 +13,7 @@ class HomeController < ApplicationController
   private
 
   def authenticate_user!
-    redirect_to(Rails.configuration.x.single_user_mode ? account_path(Account.first) : about_path) unless user_signed_in?
+    redirect_to(single_user_mode? ? account_path(Account.first) : about_path) unless user_signed_in?
   end
 
   def find_or_create_access_token