From 72bff4cdde0ca22c0f3ea07be2dfa87bcc3bf243 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Barrag=C3=A1n=20Merino?= Date: Wed, 12 Nov 2014 18:35:18 +0100 Subject: [PATCH] The GitHub button will not be rendered if is not configured --- app/coffee/modules/integrations/github.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/coffee/modules/integrations/github.coffee b/app/coffee/modules/integrations/github.coffee index 7515446f..fa61a86f 100644 --- a/app/coffee/modules/integrations/github.coffee +++ b/app/coffee/modules/integrations/github.coffee @@ -47,8 +47,8 @@ GithubLoginButtonDirective = ($window, $params, $location, $config, $events, $co """ #TODO: i18n link = ($scope, $el, $attrs) -> - redirectToUri = $location.absUrl() clientId = $config.get("gitHubClientId", null) + return if not clientId renderGitHubButton = -> $el.html(template) if clientId @@ -93,6 +93,7 @@ GithubLoginButtonDirective = ($window, $params, $location, $config, $events, $co loginWithGitHubAccount() $el.on "click", ".button-github", (event) -> + redirectToUri = $location.absUrl() url = "#{AUTH_URL}?client_id=#{clientId}&redirect_uri=#{redirectToUri}&state=github&scope=user:email" $window.location.href = url