From d2b0dce05f531d9afe9eda2c36811f4f13491403 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Janne=20He=C3=9F?= Date: Mon, 5 Jan 2026 22:43:38 +0100 Subject: [PATCH] Add option to disable local auth --- src/lib/Hydra/Controller/User.pm | 2 ++ src/root/topbar.tt | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/Hydra/Controller/User.pm b/src/lib/Hydra/Controller/User.pm index 9e7d96e5..e8dca064 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 dc35dd1f..51ab1baf 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 %]