diff options
author | Thibaut Girka <thib@sitedethib.com> | 2019-04-17 21:50:18 +0200 |
---|---|---|
committer | ThibG <thib@sitedethib.com> | 2019-04-19 00:57:39 +0200 |
commit | d83068016bbf230d4a6f767c9e57d254e1592f7c (patch) | |
tree | 209ab4e396b6d4a82f26c672a184bbcbd08cae5e /app/controllers/settings/identity_proofs_controller.rb | |
parent | e3c1472040105651fe55158b741c7ba92c1a7332 (diff) |
Allow turning keybase off instance-wide
Diffstat (limited to 'app/controllers/settings/identity_proofs_controller.rb')
-rw-r--r-- | app/controllers/settings/identity_proofs_controller.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/controllers/settings/identity_proofs_controller.rb b/app/controllers/settings/identity_proofs_controller.rb index e22b4d9be..4d0938545 100644 --- a/app/controllers/settings/identity_proofs_controller.rb +++ b/app/controllers/settings/identity_proofs_controller.rb @@ -5,6 +5,7 @@ class Settings::IdentityProofsController < Settings::BaseController before_action :authenticate_user! before_action :check_required_params, only: :new + before_action :check_enabled, only: :new def index @proofs = AccountIdentityProof.where(account: current_account).order(provider: :asc, provider_username: :asc) @@ -41,6 +42,10 @@ class Settings::IdentityProofsController < Settings::BaseController private + def check_enabled + not_found unless Setting.enable_keybase + end + def check_required_params redirect_to settings_identity_proofs_path unless [:provider, :provider_username, :username, :token].all? { |k| params[k].present? } end |