At least one redirect_uri must be available for oauthClients and applications, which are not bearer-only
This commit is contained in:
parent
37327be521
commit
e600d7c449
2 changed files with 35 additions and 31 deletions
|
@ -263,10 +263,10 @@ module.controller('ApplicationDetailCtrl', function($scope, realm, application,
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.save = function() {
|
$scope.save = function() {
|
||||||
if ($scope.create) {
|
|
||||||
if (!$scope.application.bearerOnly && (!$scope.application.redirectUris || $scope.application.redirectUris.length == 0)) {
|
if (!$scope.application.bearerOnly && (!$scope.application.redirectUris || $scope.application.redirectUris.length == 0)) {
|
||||||
Notifications.error("You must specify at least one redirect uri");
|
Notifications.error("You must specify at least one redirect uri");
|
||||||
} else {
|
} else {
|
||||||
|
if ($scope.create) {
|
||||||
Application.save({
|
Application.save({
|
||||||
realm: realm.realm,
|
realm: realm.realm,
|
||||||
application: ''
|
application: ''
|
||||||
|
@ -277,7 +277,6 @@ module.controller('ApplicationDetailCtrl', function($scope, realm, application,
|
||||||
$location.url("/realms/" + realm.realm + "/applications/" + id);
|
$location.url("/realms/" + realm.realm + "/applications/" + id);
|
||||||
Notifications.success("The application has been created.");
|
Notifications.success("The application has been created.");
|
||||||
});
|
});
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
Application.update({
|
Application.update({
|
||||||
realm : realm.realm,
|
realm : realm.realm,
|
||||||
|
@ -288,6 +287,7 @@ module.controller('ApplicationDetailCtrl', function($scope, realm, application,
|
||||||
Notifications.success("Your changes have been saved to the application.");
|
Notifications.success("Your changes have been saved to the application.");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.reset = function() {
|
$scope.reset = function() {
|
||||||
|
|
|
@ -133,6 +133,9 @@ module.controller('OAuthClientDetailCtrl', function($scope, realm, oauth, OAuthC
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.save = function() {
|
$scope.save = function() {
|
||||||
|
if (!$scope.oauth.bearerOnly && (!$scope.oauth.redirectUris || $scope.oauth.redirectUris.length == 0)) {
|
||||||
|
Notifications.error("You must specify at least one redirect uri");
|
||||||
|
} else {
|
||||||
if ($scope.create) {
|
if ($scope.create) {
|
||||||
OAuthClient.save({
|
OAuthClient.save({
|
||||||
realm: realm.realm
|
realm: realm.realm
|
||||||
|
@ -153,6 +156,7 @@ module.controller('OAuthClientDetailCtrl', function($scope, realm, oauth, OAuthC
|
||||||
Notifications.success("Your changes have been saved to the oauth client.");
|
Notifications.success("Your changes have been saved to the oauth client.");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.reset = function() {
|
$scope.reset = function() {
|
||||||
|
|
Loading…
Reference in a new issue