forked from lix-project/hydra
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:
parent
c49ca66689
commit
43d662f63a
|
@ -158,7 +158,6 @@ sub google_login :Path('/google-login') Args(0) {
|
||||||
sub github_login :Path('/github-login') Args(0) {
|
sub github_login :Path('/github-login') Args(0) {
|
||||||
my ($self, $c) = @_;
|
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_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 = $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.";
|
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) {
|
sub github_redirect :Path('/github-redirect') Args(0) {
|
||||||
my ($self, $c) = @_;
|
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_id = $c->config->{github_client_id} or die "github_client_id not configured.";
|
||||||
|
|
||||||
my $after = "/" . $c->req->params->{after};
|
my $after = "/" . $c->req->params->{after};
|
||||||
|
|
|
@ -136,7 +136,7 @@
|
||||||
<li><a href="#" id="google-signin">Sign in with Google</a></li>
|
<li><a href="#" id="google-signin">Sign in with Google</a></li>
|
||||||
<li class="divider"></li>
|
<li class="divider"></li>
|
||||||
[% END %]
|
[% 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><a href="/github-redirect?after=[% c.req.path %]">Sign in with GitHub</a></li>
|
||||||
<li class="divider"></li>
|
<li class="divider"></li>
|
||||||
[% END %]
|
[% END %]
|
||||||
|
|
Loading…
Reference in a new issue