Underpinnings of the ability to connect a GitHub account to an existing Quay account.
This commit is contained in:
parent
c72cae954b
commit
f311885e2a
8 changed files with 82 additions and 7 deletions
|
@ -265,7 +265,8 @@ quayApp = angular.module('quay', ['ngRoute', 'chieffancypants.loadingBar', 'rest
|
|||
username: null,
|
||||
email: null,
|
||||
askForPassword: false,
|
||||
organizations: []
|
||||
organizations: [],
|
||||
logins: []
|
||||
}
|
||||
|
||||
var userService = {}
|
||||
|
@ -358,9 +359,11 @@ quayApp = angular.module('quay', ['ngRoute', 'chieffancypants.loadingBar', 'rest
|
|||
if ($location.host() === 'quay.io') {
|
||||
keyService['stripePublishableKey'] = 'pk_live_P5wLU0vGdHnZGyKnXlFG4oiu';
|
||||
keyService['githubClientId'] = '5a8c08b06c48d89d4d1e';
|
||||
keyService['githubRedirectUri'] = 'https://quay.io/oauth2/github/callback';
|
||||
} else {
|
||||
keyService['stripePublishableKey'] = 'pk_test_uEDHANKm9CHCvVa2DLcipGRh';
|
||||
keyService['githubClientId'] = 'cfbc4aca88e5c1b40679';
|
||||
keyService['githubRedirectUri'] = 'http://localhost:5000/oauth2/github/callback';
|
||||
}
|
||||
|
||||
return keyService;
|
||||
|
|
|
@ -868,7 +868,7 @@ function RepoAdminCtrl($scope, Restangular, ApiService, $routeParams, $rootScope
|
|||
fetchRepository();
|
||||
}
|
||||
|
||||
function UserAdminCtrl($scope, $timeout, $location, ApiService, PlanService, UserService, KeyService, $routeParams) {
|
||||
function UserAdminCtrl($scope, $timeout, $location, ApiService, PlanService, UserService, KeyService, $routeParams, $http) {
|
||||
if ($routeParams['migrate']) {
|
||||
$('#migrateTab').tab('show')
|
||||
}
|
||||
|
@ -876,6 +876,15 @@ function UserAdminCtrl($scope, $timeout, $location, ApiService, PlanService, Use
|
|||
UserService.updateUserIn($scope, function(user) {
|
||||
$scope.askForPassword = user.askForPassword;
|
||||
$scope.cuser = jQuery.extend({}, user);
|
||||
|
||||
for (var i = 0; i < $scope.cuser.logins.length; i++) {
|
||||
if ($scope.cuser.logins[i].service == 'github') {
|
||||
var githubId = $scope.cuser.logins[i].service_identifier;
|
||||
$http.get('https://api.github.com/user/' + githubId).success(function(resp) {
|
||||
$scope.githubLogin = resp.login;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$scope.readyForPlan = function() {
|
||||
|
|
Reference in a new issue