From 43d662f63ad78acfd1b586ac8cecdfa3955a547a Mon Sep 17 00:00:00 2001 From: Jelle Besseling Date: Mon, 4 Jan 2021 18:09:49 +0100 Subject: [PATCH] Don't use enable_github_login option after all Instead the github_client_id option is used to detect if github logins should be enabled. --- src/lib/Hydra/Controller/User.pm | 2 -- src/root/topbar.tt | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/lib/Hydra/Controller/User.pm b/src/lib/Hydra/Controller/User.pm index 50bd5a15..9cdece8a 100644 --- a/src/lib/Hydra/Controller/User.pm +++ b/src/lib/Hydra/Controller/User.pm @@ -158,7 +158,6 @@ sub google_login :Path('/google-login') Args(0) { sub github_login :Path('/github-login') Args(0) { my ($self, $c) = @_; - error($c, "Logging in via GitHub is not enabled.") unless $c->config->{enable_github_login}; my $client_id = $c->config->{github_client_id} or die "github_client_id not configured."; my $client_secret = $c->config->{github_client_secret} // do { my $client_secret_file = $c->config->{github_client_secret_file} or die "github_client_secret nor github_client_secret_file is configured."; @@ -205,7 +204,6 @@ sub github_login :Path('/github-login') Args(0) { sub github_redirect :Path('/github-redirect') Args(0) { my ($self, $c) = @_; - error($c, "Logging in via GitHub is not enabled.") unless $c->config->{enable_github_login}; my $client_id = $c->config->{github_client_id} or die "github_client_id not configured."; my $after = "/" . $c->req->params->{after}; diff --git a/src/root/topbar.tt b/src/root/topbar.tt index e0156231..f8366917 100644 --- a/src/root/topbar.tt +++ b/src/root/topbar.tt @@ -136,7 +136,7 @@
  • Sign in with Google
  • [% END %] - [% IF c.config.enable_github_login %] + [% IF c.config.github_client_id %]
  • Sign in with GitHub
  • [% END %]