From 36416f2922612137edd740cd38e62afbc0b5f421 Mon Sep 17 00:00:00 2001 From: Jason Song Date: Tue, 24 Mar 2020 12:57:43 +0800 Subject: [PATCH] fix the issue that authorities record will be deleted mistakenly --- .../apollo/portal/spi/configuration/AuthConfiguration.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/configuration/AuthConfiguration.java b/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/configuration/AuthConfiguration.java index 43cc883efdd..95dcdc9d4d0 100644 --- a/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/configuration/AuthConfiguration.java +++ b/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/configuration/AuthConfiguration.java @@ -242,7 +242,7 @@ public JdbcUserDetailsManager jdbcUserDetailsManager(AuthenticationManagerBuilde jdbcUserDetailsManager .setCreateAuthoritySql("insert into `Authorities` (Username, Authority) values (?,?)"); jdbcUserDetailsManager - .setDeleteUserAuthoritiesSql("delete from `Authorities` where id = (select u.id from (select id from `Users` where Username = ?) as u)"); + .setDeleteUserAuthoritiesSql("delete from `Authorities` where id in (select a.id from (select id from `Authorities` where Username = ?) as a)"); jdbcUserDetailsManager .setChangePasswordSql("update `Users` set Password = ? where id = (select u.id from (select id from `Users` where Username = ?) as u)");