fix(authn): fix version switching error when updating multiple times
This commit is contained in:
parent
a712daaebc
commit
966348db05
|
@ -489,7 +489,7 @@ handle_call({update_authenticator, ChainName, AuthenticatorID, Config}, _From, S
|
||||||
Unique = unique(ChainName, AuthenticatorID, Version),
|
Unique = unique(ChainName, AuthenticatorID, Version),
|
||||||
case Provider:update(Config#{'_unique' => Unique}, ST) of
|
case Provider:update(Config#{'_unique' => Unique}, ST) of
|
||||||
{ok, NewST} ->
|
{ok, NewST} ->
|
||||||
NewAuthenticator = Authenticator#authenticator{state = switch_version(NewST),
|
NewAuthenticator = Authenticator#authenticator{state = switch_version(NewST#{version => Version}),
|
||||||
enable = maps:get(enable, Config)},
|
enable = maps:get(enable, Config)},
|
||||||
NewAuthenticators = replace_authenticator(AuthenticatorID, NewAuthenticator, Authenticators),
|
NewAuthenticators = replace_authenticator(AuthenticatorID, NewAuthenticator, Authenticators),
|
||||||
true = ets:insert(?CHAINS_TAB, Chain#chain{authenticators = NewAuthenticators}),
|
true = ets:insert(?CHAINS_TAB, Chain#chain{authenticators = NewAuthenticators}),
|
||||||
|
|
Loading…
Reference in New Issue