You are adding a feature where administrators can create users from the admin dashboard. After creating a user, you want to send them an email to confirm their account. Which method would you use to generate the email confirmation token?
- UserManager
.GenerateEmailConfirmationTokenAsync() - UserManager
.GeneratePasswordResetTokenAsync() - UserManager
.ConfirmEmailAsync() - UserManager
.GetUserIdAsync()
To generate an email confirmation token for a newly created user, you should use UserManager.GenerateEmailConfirmationTokenAsync(). This token can be sent to the user to confirm their email address.
Loading...
Related Quiz
- In a scenario where you have both UseStaticFiles() and UseDefaultFiles() in your Startup.cs, which one should be called first to ensure the default document is correctly served?
- In your ASP.NET Core application, you want to ensure that the code you write is free from bugs and behaves as expected. What practice would you adopt during development?
- How can you configure session timeout for a logged-in user in ASP.NET Core?
- Which method of the UserManager class in ASP.NET Core is primarily used to create a new user?
- How can you enforce a strict null check in Razor views to catch potential null reference issues at compile-time?