From 3c423eeecf81b8985271ddb5e34b0b21ed0d3596 Mon Sep 17 00:00:00 2001 From: maliming Date: Mon, 31 Aug 2026 18:49:41 +0800 Subject: [PATCH] Correct how AddTokenProvider treats an existing key It adds to the descriptor already registered under that key instead of replacing it --- docs/en/modules/identity/two-factor-authentication.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/modules/identity/two-factor-authentication.md b/docs/en/modules/identity/two-factor-authentication.md index a35140c3a9..a504739a43 100644 --- a/docs/en/modules/identity/two-factor-authentication.md +++ b/docs/en/modules/identity/two-factor-authentication.md @@ -168,7 +168,7 @@ Configure(options => ## Replacing the Verification Code Provider -If the built-in single-use behavior does not match your requirements (e.g. you need alphanumeric codes, a different storage backend or a custom delivery policy), you can replace either provider by registering your own `IUserTwoFactorTokenProvider` under the same key. `AddTokenProvider` with an existing key replaces the previous descriptor in `TokenOptions.ProviderMap`: +If the built-in single-use behavior does not match your requirements (e.g. you need alphanumeric codes, a different storage backend or a custom delivery policy), you can replace either provider by registering your own `IUserTwoFactorTokenProvider` under the same key. `AddTokenProvider` adds to the descriptor already registered under that key in `TokenOptions.ProviderMap`, and the last registration for the same user type wins: ```csharp PreConfigure(builder =>