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.
This commit is contained in:
Jelle Besseling 2021-01-04 18:09:49 +01:00
parent c49ca66689
commit 43d662f63a
No known key found for this signature in database
GPG key ID: 9712452E8BE3372E
2 changed files with 1 additions and 3 deletions

View file

@ -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};

View file

@ -136,7 +136,7 @@
<li><a href="#" id="google-signin">Sign in with Google</a></li>
<li class="divider"></li>
[% END %]
[% IF c.config.enable_github_login %]
[% IF c.config.github_client_id %]
<li><a href="/github-redirect?after=[% c.req.path %]">Sign in with GitHub</a></li>
<li class="divider"></li>
[% END %]