Skip to content

Unable to Regenerate a Two Factor Token when User clicks Resend Code #18557

@ejstan

Description

@ejstan

Hi,

I'm trying to implement a functionality when a logs in he/she will receive a SMS containing a verification code and he/she must enter it to the web app in order to log in and should have the option to resend the code. When the user clicks on "Resend Code" a new Two Factor code must be generated and sent to his/her email. So far whenever I call the following code below it returns me the previous generated code:

 // Generate the token and send it via SMS
 var code = await _userManager.GenerateTwoFactorTokenAsync(user, "Phone");

Any ideas on how to implement this or what I'm doing wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: Author FeedbackThe author of this issue needs to respond in order for us to continue investigating this issue.Status: No Recent Activityarea-identityIncludes: Identity and providers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions