Skip to content

Commit d2b0dce

Browse files
committed
Add option to disable local auth
1 parent a31f5d6 commit d2b0dce

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/lib/Hydra/Controller/User.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ sub login :Local :Args(0) :ActionClass('REST') { }
2525
sub login_POST {
2626
my ($self, $c) = @_;
2727

28+
badRequest($c, "Local authentication is disabled.") if $c->config->{disable_local_auth};
29+
2830
my $username = $c->stash->{params}->{username} // "";
2931
my $password = $c->stash->{params}->{password} // "";
3032

src/root/topbar.tt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,9 @@
146146
<a class="dropdown-item" href="/github-redirect?after=[% c.req.path | uri %]">Sign in with GitHub</a>
147147
<div class="dropdown-divider"></div>
148148
[% END %]
149-
<a class="dropdown-item" href="#hydra-signin" data-toggle="modal">Sign in with a Hydra account</a>
149+
[% UNLESS c.config.disable_local_auth %]
150+
<a class="dropdown-item" href="#hydra-signin" data-toggle="modal">Sign in with a Hydra account</a>
151+
[% END %]
150152
[% END %]
151153
[% END %]
152154

0 commit comments

Comments
 (0)