Browse Source

Correct how AddTokenProvider treats an existing key

It adds to the descriptor already registered under that key instead of replacing it
pull/26113/head
maliming 3 days ago
parent
commit
3c423eeecf
No known key found for this signature in database GPG Key ID: A646B9CB645ECEA4
  1. 2
      docs/en/modules/identity/two-factor-authentication.md

2
docs/en/modules/identity/two-factor-authentication.md

@ -168,7 +168,7 @@ Configure<AbpPhoneNumberTwoFactorTokenProviderOptions>(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<IdentityUser>` 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<IdentityUser>` 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<IdentityBuilder>(builder =>

Loading…
Cancel
Save