The GitHub button will not be rendered if is not configured

stable
David Barragán Merino 2014-11-12 18:35:18 +01:00
parent b4e5df0c8d
commit 72bff4cdde
1 changed files with 2 additions and 1 deletions

View File

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