62 lines
2.1 KiB
Plaintext
62 lines
2.1 KiB
Plaintext
@model IdentitySample.Models.ManageLoginsViewModel
|
|
@using Microsoft.Owin.Security
|
|
@{
|
|
//TODO: Until we have a way to specify the layout page at application level.
|
|
Layout = "/Views/Shared/_Layout.cshtml";
|
|
ViewBag.Title = "Manage your external logins";
|
|
}
|
|
|
|
<h2>@ViewBag.Title.</h2>
|
|
|
|
<p class="text-success">@ViewBag.StatusMessage</p>
|
|
@if (Model.CurrentLogins.Count > 0)
|
|
{
|
|
<h4>Registered Logins</h4>
|
|
<table class="table">
|
|
<tbody>
|
|
@foreach (var account in Model.CurrentLogins)
|
|
{
|
|
<tr>
|
|
<td>@account.LoginProvider</td>
|
|
<td>
|
|
@if (ViewBag.ShowRemoveButton)
|
|
{
|
|
using (Html.BeginForm("RemoveLogin", "Manage"))
|
|
{
|
|
@Html.AntiForgeryToken()
|
|
<div>
|
|
@Html.Hidden("loginProvider", account.LoginProvider)
|
|
@Html.Hidden("providerKey", account.ProviderKey)
|
|
<input type="submit" class="btn btn-default" value="Remove" title="Remove this @account.LoginProvider login from your account" />
|
|
</div>
|
|
}
|
|
}
|
|
else
|
|
{
|
|
@:
|
|
}
|
|
</td>
|
|
</tr>
|
|
}
|
|
</tbody>
|
|
</table>
|
|
}
|
|
@if (Model.OtherLogins.Count > 0)
|
|
{
|
|
<h4>Add another service to log in.</h4>
|
|
<hr />
|
|
using (Html.BeginForm("LinkLogin", "Manage"))
|
|
{
|
|
@Html.AntiForgeryToken()
|
|
<div id="socialLoginList">
|
|
<p>
|
|
@foreach (AuthenticationDescription p in Model.OtherLogins)
|
|
{
|
|
<button type="submit" class="btn btn-default" id="@p.AuthenticationType" name="provider" value="@p.AuthenticationType" title="Log in using your @p.Caption account">@p.AuthenticationType</button>
|
|
}
|
|
</p>
|
|
</div>
|
|
}
|
|
}
|
|
|