ShowRecoveryCodes.cshtml.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // Licensed to the .NET Foundation under one or more agreements.
  2. // The .NET Foundation licenses this file to you under the MIT license.
  3. #nullable disable
  4. using Microsoft.AspNetCore.Identity;
  5. using Microsoft.AspNetCore.Mvc;
  6. using Microsoft.AspNetCore.Mvc.RazorPages;
  7. using Microsoft.Extensions.Logging;
  8. namespace Admin.Areas.Identity.Pages.Account.Manage;
  9. /// <summary>
  10. /// This API supports the ASP.NET Core Identity default UI infrastructure and is not intended to be used
  11. /// directly from your code. This API may change or be removed in future releases.
  12. /// </summary>
  13. public class ShowRecoveryCodesModel : PageModel
  14. {
  15. /// <summary>
  16. /// This API supports the ASP.NET Core Identity default UI infrastructure and is not intended to be used
  17. /// directly from your code. This API may change or be removed in future releases.
  18. /// </summary>
  19. [TempData]
  20. public string[] RecoveryCodes { get; set; }
  21. /// <summary>
  22. /// This API supports the ASP.NET Core Identity default UI infrastructure and is not intended to be used
  23. /// directly from your code. This API may change or be removed in future releases.
  24. /// </summary>
  25. [TempData]
  26. public string StatusMessage { get; set; }
  27. /// <summary>
  28. /// This API supports the ASP.NET Core Identity default UI infrastructure and is not intended to be used
  29. /// directly from your code. This API may change or be removed in future releases.
  30. /// </summary>
  31. public IActionResult OnGet()
  32. {
  33. if (RecoveryCodes == null || RecoveryCodes.Length == 0)
  34. {
  35. return RedirectToPage("./TwoFactorAuthentication");
  36. }
  37. return Page();
  38. }
  39. }