ManageLogins.cshtml 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. @model ManageLoginsViewModel
  2. @using Microsoft.AspNetCore.Http.Authentication
  3. @{
  4. ViewData["Title"] = "Manage your external logins";
  5. }
  6. <h2>@ViewData["Title"].</h2>
  7. <p class="text-success">@ViewData["StatusMessage"]</p>
  8. @if (Model.CurrentLogins.Count > 0)
  9. {
  10. <h4>Registered Logins</h4>
  11. <table class="table">
  12. <tbody>
  13. @for (var index = 0; index < Model.CurrentLogins.Count; index++)
  14. {
  15. <tr>
  16. <td>@Model.CurrentLogins[index].LoginProvider</td>
  17. <td>
  18. @if ((bool)ViewData["ShowRemoveButton"])
  19. {
  20. <form asp-controller="Manage" asp-action="RemoveLogin" method="post" class="form-horizontal">
  21. <div>
  22. <input asp-for="@Model.CurrentLogins[index].LoginProvider" name="LoginProvider" type="hidden" />
  23. <input asp-for="@Model.CurrentLogins[index].ProviderKey" name="ProviderKey" type="hidden" />
  24. <input type="submit" class="btn btn-default" value="Remove" title="Remove this @Model.CurrentLogins[index].LoginProvider login from your account" />
  25. </div>
  26. </form>
  27. }
  28. else
  29. {
  30. @: &nbsp;
  31. }
  32. </td>
  33. </tr>
  34. }
  35. </tbody>
  36. </table>
  37. }
  38. @if (Model.OtherLogins.Count > 0)
  39. {
  40. <h4>Add another service to log in.</h4>
  41. <hr />
  42. <form asp-controller="Manage" asp-action="LinkLogin" method="post" class="form-horizontal">
  43. <div id="socialLoginList">
  44. <p>
  45. @foreach (var provider in Model.OtherLogins)
  46. {
  47. <button type="submit" class="btn btn-default" name="provider" value="@provider.AuthenticationScheme" title="Log in using your @provider.DisplayName account">@provider.AuthenticationScheme</button>
  48. }
  49. </p>
  50. </div>
  51. </form>
  52. }