From 966348db059ef72a8ac4028f0abdd54b15752984 Mon Sep 17 00:00:00 2001 From: zhouzb Date: Fri, 29 Oct 2021 10:12:29 +0800 Subject: [PATCH] fix(authn): fix version switching error when updating multiple times --- apps/emqx/src/emqx_authentication.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/emqx/src/emqx_authentication.erl b/apps/emqx/src/emqx_authentication.erl index 226d697d8..765437163 100644 --- a/apps/emqx/src/emqx_authentication.erl +++ b/apps/emqx/src/emqx_authentication.erl @@ -489,7 +489,7 @@ handle_call({update_authenticator, ChainName, AuthenticatorID, Config}, _From, S Unique = unique(ChainName, AuthenticatorID, Version), case Provider:update(Config#{'_unique' => Unique}, ST) of {ok, NewST} -> - NewAuthenticator = Authenticator#authenticator{state = switch_version(NewST), + NewAuthenticator = Authenticator#authenticator{state = switch_version(NewST#{version => Version}), enable = maps:get(enable, Config)}, NewAuthenticators = replace_authenticator(AuthenticatorID, NewAuthenticator, Authenticators), true = ets:insert(?CHAINS_TAB, Chain#chain{authenticators = NewAuthenticators}),