diff --git a/src/lib/Hydra/Controller/User.pm b/src/lib/Hydra/Controller/User.pm index 9e7d96e5a..e8dca0646 100644 --- a/src/lib/Hydra/Controller/User.pm +++ b/src/lib/Hydra/Controller/User.pm @@ -25,6 +25,8 @@ sub login :Local :Args(0) :ActionClass('REST') { } sub login_POST { my ($self, $c) = @_; + badRequest($c, "Local authentication is disabled.") if $c->config->{disable_local_auth}; + my $username = $c->stash->{params}->{username} // ""; my $password = $c->stash->{params}->{password} // ""; diff --git a/src/root/topbar.tt b/src/root/topbar.tt index dc35dd1fe..51ab1baf9 100644 --- a/src/root/topbar.tt +++ b/src/root/topbar.tt @@ -146,7 +146,9 @@ Sign in with GitHub
[% END %] - Sign in with a Hydra account + [% UNLESS c.config.disable_local_auth %] + Sign in with a Hydra account + [% END %] [% END %] [% END %]