about summary refs log tree commit diff
path: root/app/controllers/well_known/keybase_proof_config_controller.rb
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2019-04-17 21:50:18 +0200
committerThibG <thib@sitedethib.com>2019-04-19 00:57:39 +0200
commitd83068016bbf230d4a6f767c9e57d254e1592f7c (patch)
tree209ab4e396b6d4a82f26c672a184bbcbd08cae5e /app/controllers/well_known/keybase_proof_config_controller.rb
parente3c1472040105651fe55158b741c7ba92c1a7332 (diff)
Allow turning keybase off instance-wide
Diffstat (limited to 'app/controllers/well_known/keybase_proof_config_controller.rb')
-rw-r--r--app/controllers/well_known/keybase_proof_config_controller.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/controllers/well_known/keybase_proof_config_controller.rb b/app/controllers/well_known/keybase_proof_config_controller.rb
index eb41e586f..c78683a8d 100644
--- a/app/controllers/well_known/keybase_proof_config_controller.rb
+++ b/app/controllers/well_known/keybase_proof_config_controller.rb
@@ -2,8 +2,16 @@
 
 module WellKnown
   class KeybaseProofConfigController < ActionController::Base
+    before_action :check_enabled
+
     def show
       render json: {}, serializer: ProofProvider::Keybase::ConfigSerializer
     end
+
+    private
+
+    def check_enabled
+      head 404 unless Setting.enable_keybase
+    end
   end
 end