From 8b023f57f92bd14eea5b90889e2a2b2adafab130 Mon Sep 17 00:00:00 2001 From: Stan Silvert Date: Tue, 14 Nov 2017 16:12:56 -0500 Subject: [PATCH] KEYCLOAK-5474: Unexp behavior with "login w/ email" and "Dup emails" (#4683) settings. --- .../theme/base/admin/resources/js/controllers/realm.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/themes/src/main/resources/theme/base/admin/resources/js/controllers/realm.js b/themes/src/main/resources/theme/base/admin/resources/js/controllers/realm.js index db3fd4bb18..715effa292 100644 --- a/themes/src/main/resources/theme/base/admin/resources/js/controllers/realm.js +++ b/themes/src/main/resources/theme/base/admin/resources/js/controllers/realm.js @@ -352,7 +352,7 @@ function genericRealmUpdate($scope, Current, Realm, realm, serverInfo, $http, $l $scope.changed = true; } }, true); - + $scope.save = function() { var realmCopy = angular.copy($scope.realm); console.log('updating realm...'); @@ -391,6 +391,13 @@ module.controller('DefenseHeadersCtrl', function($scope, Current, Realm, realm, }); module.controller('RealmLoginSettingsCtrl', function($scope, Current, Realm, realm, serverInfo, $http, $location, Dialog, Notifications) { + // KEYCLOAK-5474: Make sure duplicateEmailsAllowed is disabled if loginWithEmailAllowed + $scope.$watch('realm.loginWithEmailAllowed', function() { + if ($scope.realm.loginWithEmailAllowed) { + $scope.realm.duplicateEmailsAllowed = false; + } + }); + genericRealmUpdate($scope, Current, Realm, realm, serverInfo, $http, $location, Dialog, Notifications, "/realms/" + realm.realm + "/login-settings"); });