File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change 1
1
module Authenticator
2
2
def self . for ( config , username = nil )
3
- if username == 'admin'
3
+ if username == 'admin' && !:: Settings . authentication . local_login_disabled
4
4
Database . new ( config )
5
5
else
6
6
authenticator_class ( config [ :mode ] ) &.new ( config )
Original file line number Diff line number Diff line change 12
12
expect ( Authenticator . for ( { :mode => 'ldap' } , 'admin' ) ) . to be_a ( Authenticator ::Database )
13
13
expect ( Authenticator . for ( { :mode => 'httpd' } , 'admin' ) ) . to be_a ( Authenticator ::Database )
14
14
end
15
+
16
+ it "instantiates matching class for admin when local_login_disabled is enabled" do
17
+ stub_settings_merge ( :authentication => { :local_login_disabled => true } )
18
+ expect ( Authenticator . for ( { :mode => 'httpd' } , 'admin' ) ) . to be_a ( Authenticator ::Httpd )
19
+ end
15
20
end
16
21
17
22
describe '#authorize' do
You can’t perform that action at this time.
0 commit comments