PR changes
This commit is contained in:
parent
4ca5d9b04b
commit
2e840654d3
3 changed files with 11 additions and 4 deletions
|
@ -193,10 +193,12 @@ def github_oauth_callback():
|
|||
|
||||
found_email = None
|
||||
for user_email in get_email.json():
|
||||
if not user_email['primary'] or not user_email['verified']:
|
||||
break
|
||||
if not user_email['verified']:
|
||||
continue
|
||||
|
||||
found_email = user_email['email']
|
||||
if user_email['primary']:
|
||||
break
|
||||
|
||||
if found_email is None:
|
||||
err = 'There is no verified e-mail address attached to the GitHub account.'
|
||||
|
|
|
@ -23,7 +23,11 @@ angular.module('quay').factory('KeyService', ['$location', 'Config', function($l
|
|||
keyService['githubTriggerEndpoint'] = oauth['GITHUB_TRIGGER_CONFIG']['GITHUB_ENDPOINT'];
|
||||
keyService['githubTriggerAuthorizeUrl'] = oauth['GITHUB_TRIGGER_CONFIG']['AUTHORIZE_ENDPOINT'];
|
||||
|
||||
keyService['githubLoginScope'] = 'user:email,read:org';
|
||||
keyService['githubLoginScope'] = 'user:email';
|
||||
if (oauth['GITHUB_LOGIN_CONFIG']['ORG_RESTRICT']) {
|
||||
keyService['githubLoginScope'] += ',read:org';
|
||||
}
|
||||
|
||||
keyService['googleLoginScope'] = 'openid email';
|
||||
|
||||
keyService.isEnterprise = function(service) {
|
||||
|
|
|
@ -117,7 +117,8 @@ class GithubOAuthConfig(OAuthConfig):
|
|||
return {
|
||||
'CLIENT_ID': self.client_id(),
|
||||
'AUTHORIZE_ENDPOINT': self.authorize_endpoint(),
|
||||
'GITHUB_ENDPOINT': self._endpoint()
|
||||
'GITHUB_ENDPOINT': self._endpoint(),
|
||||
'ORG_RESTRICT': self.config.get('ORG_RESTRICT', False)
|
||||
}
|
||||
|
||||
|
||||
|
|
Reference in a new issue