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
|
found_email = None
|
||||||
for user_email in get_email.json():
|
for user_email in get_email.json():
|
||||||
if not user_email['primary'] or not user_email['verified']:
|
if not user_email['verified']:
|
||||||
break
|
continue
|
||||||
|
|
||||||
found_email = user_email['email']
|
found_email = user_email['email']
|
||||||
|
if user_email['primary']:
|
||||||
|
break
|
||||||
|
|
||||||
if found_email is None:
|
if found_email is None:
|
||||||
err = 'There is no verified e-mail address attached to the GitHub account.'
|
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['githubTriggerEndpoint'] = oauth['GITHUB_TRIGGER_CONFIG']['GITHUB_ENDPOINT'];
|
||||||
keyService['githubTriggerAuthorizeUrl'] = oauth['GITHUB_TRIGGER_CONFIG']['AUTHORIZE_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['googleLoginScope'] = 'openid email';
|
||||||
|
|
||||||
keyService.isEnterprise = function(service) {
|
keyService.isEnterprise = function(service) {
|
||||||
|
|
|
@ -117,7 +117,8 @@ class GithubOAuthConfig(OAuthConfig):
|
||||||
return {
|
return {
|
||||||
'CLIENT_ID': self.client_id(),
|
'CLIENT_ID': self.client_id(),
|
||||||
'AUTHORIZE_ENDPOINT': self.authorize_endpoint(),
|
'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