Dela via


IUserTwoFactorRecoveryCodeStore<TUser>.RedeemCodeAsync Method

Definition

Returns whether a recovery code is valid for a user. Note: recovery codes are only valid once, and will be invalid after use.

public:
 System::Threading::Tasks::Task<bool> ^ RedeemCodeAsync(TUser user, System::String ^ code, System::Threading::CancellationToken cancellationToken);
public System.Threading.Tasks.Task<bool> RedeemCodeAsync (TUser user, string code, System.Threading.CancellationToken cancellationToken);
abstract member RedeemCodeAsync : 'User * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<bool>
Public Function RedeemCodeAsync (user As TUser, code As String, cancellationToken As CancellationToken) As Task(Of Boolean)

Parameters

user
TUser

The user who owns the recovery code.

code
String

The recovery code to use.

cancellationToken
CancellationToken

The CancellationToken used to propagate notifications that the operation should be canceled.

Returns

True if the recovery code was found for the user.

Applies to