Commit 532f8cbd authored by Andrew Smith's avatar Andrew Smith

If SSH prototol is disabled don't say the user requires SSH keys

parent 42dc2033
......@@ -512,7 +512,7 @@ class User < ActiveRecord::Base
end
def require_ssh_key?
keys.count == 0
keys.count == 0 && Gitlab::ProtocolAccess.allowed?('ssh')
end
def require_password?
......
---
title: Don't display prompt to add SSH keys if SSH protocol is disabled
merge_request: 7840
author: Andrew Smith (EspadaV8)
......@@ -575,6 +575,18 @@ describe User, models: true do
end
end
end
context 'when current_application_settings.enabled_git_access_protocol does not contain SSH' do
before do
stub_application_setting(enabled_git_access_protocol: 'HTTP')
end
it "doesn't require user to have SSH key" do
user = build(:user)
expect(user.require_ssh_key?).to be_falsey
end
end
end
describe '.find_by_any_email' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment