The GitHub button will not be rendered if is not configured
parent
b4e5df0c8d
commit
72bff4cdde
|
@ -47,8 +47,8 @@ GithubLoginButtonDirective = ($window, $params, $location, $config, $events, $co
|
||||||
""" #TODO: i18n
|
""" #TODO: i18n
|
||||||
|
|
||||||
link = ($scope, $el, $attrs) ->
|
link = ($scope, $el, $attrs) ->
|
||||||
redirectToUri = $location.absUrl()
|
|
||||||
clientId = $config.get("gitHubClientId", null)
|
clientId = $config.get("gitHubClientId", null)
|
||||||
|
return if not clientId
|
||||||
|
|
||||||
renderGitHubButton = ->
|
renderGitHubButton = ->
|
||||||
$el.html(template) if clientId
|
$el.html(template) if clientId
|
||||||
|
@ -93,6 +93,7 @@ GithubLoginButtonDirective = ($window, $params, $location, $config, $events, $co
|
||||||
loginWithGitHubAccount()
|
loginWithGitHubAccount()
|
||||||
|
|
||||||
$el.on "click", ".button-github", (event) ->
|
$el.on "click", ".button-github", (event) ->
|
||||||
|
redirectToUri = $location.absUrl()
|
||||||
url = "#{AUTH_URL}?client_id=#{clientId}&redirect_uri=#{redirectToUri}&state=github&scope=user:email"
|
url = "#{AUTH_URL}?client_id=#{clientId}&redirect_uri=#{redirectToUri}&state=github&scope=user:email"
|
||||||
$window.location.href = url
|
$window.location.href = url
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue