Got most of admin panel working. Data issues fixed
This commit is contained in:
@@ -2,7 +2,8 @@
|
||||
|
||||
@using System.ComponentModel.DataAnnotations
|
||||
@using Microsoft.AspNetCore.Identity
|
||||
@using OpenArchival.Blazor.Data
|
||||
@using MyAppName.WebApp.Components.Account
|
||||
@using OpenArchival.DataAccess
|
||||
|
||||
@inject UserManager<ApplicationUser> UserManager
|
||||
@inject SignInManager<ApplicationUser> SignInManager
|
||||
@@ -12,34 +13,32 @@
|
||||
|
||||
<PageTitle>Change password</PageTitle>
|
||||
|
||||
<MudText Typo="Typo.h6" GutterBottom="true">Change password</MudText>
|
||||
|
||||
<h3>Change password</h3>
|
||||
<StatusMessage Message="@message" />
|
||||
|
||||
<EditForm Model="Input" FormName="change-password" OnValidSubmit="OnValidSubmitAsync" method="post">
|
||||
<DataAnnotationsValidator />
|
||||
|
||||
<MudGrid>
|
||||
<MudItem md="12">
|
||||
<MudTextField For="@(() => Input.OldPassword)" @bind-Value="Input.OldPassword" InputType="InputType.Password"
|
||||
Label="Old Password" Placeholder="old password" HelperText="Please enter your old password."
|
||||
UserAttributes="@(new() { { "autocomplete", "current-password" }, { "aria-required", "true" } } )" />
|
||||
</MudItem>
|
||||
<MudItem md="12">
|
||||
<MudTextField For="@(() => Input.NewPassword)" @bind-Value="Input.NewPassword" InputType="InputType.Password"
|
||||
Label="New Password" Placeholder="new password" HelperText="Please enter your new password."
|
||||
UserAttributes="@(new() { { "autocomplete", "new-password" }, { "aria-required", "true" } } )" />
|
||||
</MudItem>
|
||||
<MudItem md="12">
|
||||
<MudTextField For="@(() => Input.ConfirmPassword)" @bind-Value="Input.ConfirmPassword" InputType="InputType.Password"
|
||||
Label="Confirm Password" Placeholder="confirm password" HelperText="Please confirm your new password."
|
||||
UserAttributes="@(new() { { "autocomplete", "new-password" }, { "aria-required", "true" } } )" />
|
||||
</MudItem>
|
||||
<MudItem md="12">
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Primary" FullWidth="true" FormAction="FormAction.Submit">Update password</MudButton>
|
||||
</MudItem>
|
||||
</MudGrid>
|
||||
</EditForm>
|
||||
<div class="row">
|
||||
<div class="col-xl-6">
|
||||
<EditForm Model="Input" FormName="change-password" OnValidSubmit="OnValidSubmitAsync" method="post">
|
||||
<DataAnnotationsValidator />
|
||||
<ValidationSummary class="text-danger" role="alert" />
|
||||
<div class="form-floating mb-3">
|
||||
<InputText type="password" @bind-Value="Input.OldPassword" id="Input.OldPassword" class="form-control" autocomplete="current-password" aria-required="true" placeholder="Enter the old password" />
|
||||
<label for="Input.OldPassword" class="form-label">Old password</label>
|
||||
<ValidationMessage For="() => Input.OldPassword" class="text-danger" />
|
||||
</div>
|
||||
<div class="form-floating mb-3">
|
||||
<InputText type="password" @bind-Value="Input.NewPassword" id="Input.NewPassword" class="form-control" autocomplete="new-password" aria-required="true" placeholder="Enter the new password" />
|
||||
<label for="Input.NewPassword" class="form-label">New password</label>
|
||||
<ValidationMessage For="() => Input.NewPassword" class="text-danger" />
|
||||
</div>
|
||||
<div class="form-floating mb-3">
|
||||
<InputText type="password" @bind-Value="Input.ConfirmPassword" id="Input.ConfirmPassword" class="form-control" autocomplete="new-password" aria-required="true" placeholder="Enter the new password" />
|
||||
<label for="Input.ConfirmPassword" class="form-label">Confirm password</label>
|
||||
<ValidationMessage For="() => Input.ConfirmPassword" class="text-danger" />
|
||||
</div>
|
||||
<button type="submit" class="w-100 btn btn-lg btn-primary">Update password</button>
|
||||
</EditForm>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
private string? message;
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
@using System.ComponentModel.DataAnnotations
|
||||
@using Microsoft.AspNetCore.Identity
|
||||
@using OpenArchival.Blazor.Data
|
||||
@using MyAppName.WebApp.Components.Account
|
||||
@using OpenArchival.DataAccess
|
||||
|
||||
@inject UserManager<ApplicationUser> UserManager
|
||||
@inject SignInManager<ApplicationUser> SignInManager
|
||||
@@ -12,31 +13,31 @@
|
||||
|
||||
<PageTitle>Delete Personal Data</PageTitle>
|
||||
|
||||
<MudText Typo="Typo.h6" GutterBottom="true">Delete personal data</MudText>
|
||||
|
||||
<StatusMessage Message="@message" />
|
||||
|
||||
<MudAlert Severity="Severity.Error" Variant="Variant.Text">
|
||||
Deleting this data will permanently remove your account, and this cannot be recovered.
|
||||
</MudAlert>
|
||||
<h3>Delete Personal Data</h3>
|
||||
|
||||
<EditForm Model="Input" FormName="delete-user" OnValidSubmit="OnValidSubmitAsync" method="post">
|
||||
<DataAnnotationsValidator />
|
||||
<div class="alert alert-warning" role="alert">
|
||||
<p>
|
||||
<strong>Deleting this data will permanently remove your account, and this cannot be recovered.</strong>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<MudGrid>
|
||||
<div>
|
||||
<EditForm Model="Input" FormName="delete-user" OnValidSubmit="OnValidSubmitAsync" method="post">
|
||||
<DataAnnotationsValidator />
|
||||
<ValidationSummary class="text-danger" role="alert" />
|
||||
@if (requirePassword)
|
||||
{
|
||||
<MudItem md="12">
|
||||
<MudTextField For="@(() => Input.Password)" @bind-Value="Input.Password" InputType="InputType.Password"
|
||||
Label="Password" Placeholder="password" HelperText="Please enter your new password."
|
||||
UserAttributes="@(new() { { "autocomplete", "current-password" }, { "aria-required", "true" } } )" />
|
||||
</MudItem>
|
||||
<div class="form-floating mb-3">
|
||||
<InputText type="password" @bind-Value="Input.Password" id="Input.Password" class="form-control" autocomplete="current-password" aria-required="true" placeholder="Please enter your password." />
|
||||
<label for="Input.Password" class="form-label">Password</label>
|
||||
<ValidationMessage For="() => Input.Password" class="text-danger" />
|
||||
</div>
|
||||
}
|
||||
<MudItem md="12">
|
||||
<MudStaticButton Variant="Variant.Filled" Color="Color.Primary" FullWidth="true" FormAction="FormAction.Submit">Delete data and close my account</MudStaticButton>
|
||||
</MudItem>
|
||||
</MudGrid>
|
||||
</EditForm>
|
||||
<button class="w-100 btn btn-lg btn-danger" type="submit">Delete data and close my account</button>
|
||||
</EditForm>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
private string? message;
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
@page "/Account/Manage/Disable2fa"
|
||||
|
||||
@using Microsoft.AspNetCore.Identity
|
||||
@using OpenArchival.Blazor.Data
|
||||
@using MyAppName.WebApp.Components.Account
|
||||
@using OpenArchival.DataAccess
|
||||
|
||||
@inject UserManager<ApplicationUser> UserManager
|
||||
@inject IdentityUserAccessor UserAccessor
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
@using System.Text.Encodings.Web
|
||||
@using Microsoft.AspNetCore.Identity
|
||||
@using Microsoft.AspNetCore.WebUtilities
|
||||
@using OpenArchival.Blazor.Data
|
||||
@using MyAppName.WebApp.Components.Account
|
||||
@using OpenArchival.DataAccess
|
||||
|
||||
@inject UserManager<ApplicationUser> UserManager
|
||||
@inject IEmailSender<ApplicationUser> EmailSender
|
||||
@@ -14,43 +15,44 @@
|
||||
|
||||
<PageTitle>Manage email</PageTitle>
|
||||
|
||||
<MudText Typo="Typo.h6" GutterBottom="true">Manage email</MudText>
|
||||
<h3>Manage email</h3>
|
||||
|
||||
<StatusMessage Message="@message" />
|
||||
|
||||
<form @onsubmit="OnSendEmailVerificationAsync" @formname="send-verification" id="send-verification-form" method="post">
|
||||
<AntiforgeryToken />
|
||||
</form>
|
||||
<EditForm Model="Input" FormName="change-email" OnValidSubmit="OnValidSubmitAsync" method="post">
|
||||
<DataAnnotationsValidator />
|
||||
|
||||
<MudGrid>
|
||||
|
||||
@if (isEmailConfirmed)
|
||||
{
|
||||
<MudItem md="12">
|
||||
<MudTextField Value="@email" Label="Email" Placeholder="Please enter your email." Disabled="true" AdornmentIcon="Icons.Material.Filled.Check" AdornmentColor="Color.Success" />
|
||||
</MudItem>
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudItem md="12">
|
||||
<MudTextField Value="@email" Label="Email" Placeholder="Please enter your email." Disabled="true" />
|
||||
</MudItem>
|
||||
<MudItem md="12">
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Primary" FullWidth="true" FormAction="FormAction.Submit">Send verification email</MudButton>
|
||||
</MudItem>
|
||||
}
|
||||
|
||||
<MudItem md="12">
|
||||
<MudTextField @bind-Value="@Input.NewEmail" For="@(() => Input.NewEmail)" UserAttributes="@(new() { { "autocomplete", "email" }, { "aria-required", "true" } } )" Label="New Email" HelperText="Please enter new email." />
|
||||
</MudItem>
|
||||
|
||||
<MudItem md="12">
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Primary" FullWidth="true" FormAction="FormAction.Submit">Change email</MudButton>
|
||||
</MudItem>
|
||||
</MudGrid>
|
||||
</EditForm>
|
||||
<StatusMessage Message="@message"/>
|
||||
<div class="row">
|
||||
<div class="col-xl-6">
|
||||
<form @onsubmit="OnSendEmailVerificationAsync" @formname="send-verification" id="send-verification-form" method="post">
|
||||
<AntiforgeryToken />
|
||||
</form>
|
||||
<EditForm Model="Input" FormName="change-email" OnValidSubmit="OnValidSubmitAsync" method="post">
|
||||
<DataAnnotationsValidator />
|
||||
<ValidationSummary class="text-danger" role="alert" />
|
||||
@if (isEmailConfirmed)
|
||||
{
|
||||
<div class="form-floating mb-3 input-group">
|
||||
<input type="text" value="@email" id="email" class="form-control" placeholder="Enter your email" disabled />
|
||||
<div class="input-group-append">
|
||||
<span class="h-100 input-group-text text-success font-weight-bold">✓</span>
|
||||
</div>
|
||||
<label for="email" class="form-label">Email</label>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="form-floating mb-3">
|
||||
<input type="text" value="@email" id="email" class="form-control" placeholder="Enter your email" disabled />
|
||||
<label for="email" class="form-label">Email</label>
|
||||
<button type="submit" class="btn btn-link" form="send-verification-form">Send verification email</button>
|
||||
</div>
|
||||
}
|
||||
<div class="form-floating mb-3">
|
||||
<InputText @bind-Value="Input.NewEmail" id="Input.NewEmail" class="form-control" autocomplete="email" aria-required="true" placeholder="Enter a new email" />
|
||||
<label for="Input.NewEmail" class="form-label">New email</label>
|
||||
<ValidationMessage For="() => Input.NewEmail" class="text-danger" />
|
||||
</div>
|
||||
<button type="submit" class="w-100 btn btn-lg btn-primary">Change email</button>
|
||||
</EditForm>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
private string? message;
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
@using System.Text
|
||||
@using System.Text.Encodings.Web
|
||||
@using Microsoft.AspNetCore.Identity
|
||||
@using OpenArchival.Blazor.Data
|
||||
@using MyAppName.WebApp.Components.Account
|
||||
@using OpenArchival.DataAccess
|
||||
|
||||
@inject UserManager<ApplicationUser> UserManager
|
||||
@inject IdentityUserAccessor UserAccessor
|
||||
@@ -21,55 +22,49 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudText Typo="Typo.h6" GutterBottom="true">Configure authenticator app</MudText>
|
||||
|
||||
<StatusMessage Message="@message" />
|
||||
|
||||
<MudText Typo="Typo.body1" GutterBottom="true">To use an authenticator app go through the following steps:</MudText>
|
||||
|
||||
<ol class="list">
|
||||
<li>
|
||||
<MudText Typo="Typo.body2">
|
||||
Download a two-factor authenticator app like Microsoft Authenticator for
|
||||
<MudLink Target="_blank" Href="https://go.microsoft.com/fwlink/?Linkid=825072">Android</MudLink> and
|
||||
<MudLink Target="_blank" Href="https://go.microsoft.com/fwlink/?Linkid=825073">iOS</MudLink> or
|
||||
Google Authenticator for
|
||||
<MudLink Target="_blank" Href="https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2&hl=en">Android</MudLink> and
|
||||
<MudLink Target="_blank" Href="https://itunes.apple.com/us/app/google-authenticator/id388497605?mt=8">iOS</MudLink>.
|
||||
</MudText>
|
||||
</li>
|
||||
<li>
|
||||
<MudText Typo="Typo.body2">
|
||||
Scan the QR Code or enter this key into your two factor authenticator app. Spaces and casing do not matter:
|
||||
</MudText>
|
||||
|
||||
<MudAlert Variant="Variant.Text" Severity="Severity.Info" Icon="@Icons.Material.Filled.Key">@sharedKey</MudAlert>
|
||||
|
||||
<MudText Typo="Typo.body2">
|
||||
Learn how to <MudLink Target="_blank" Href="https://go.microsoft.com/fwlink/?Linkid=852423">enable QR code generation</MudLink>.
|
||||
</MudText>
|
||||
|
||||
<div data-url="@authenticatorUri"></div>
|
||||
</li>
|
||||
<li>
|
||||
<MudText Typo="Typo.body2">
|
||||
Once you have scanned the QR code or input the key above, your two factor authentication app will provide you
|
||||
with a unique code. Enter the code in the confirmation box below.
|
||||
</MudText>
|
||||
|
||||
<EditForm Model="Input" FormName="send-code" OnValidSubmit="OnValidSubmitAsync" method="post">
|
||||
<DataAnnotationsValidator />
|
||||
<MudGrid>
|
||||
<MudItem md="12">
|
||||
<MudTextField @bind-Value="@Input.Code" For="@(() => Input.Code)" Label="Verification Code" HelperText="Please enter the code." />
|
||||
</MudItem>
|
||||
<MudItem md="12">
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Primary" FullWidth="true" FormAction="FormAction.Submit">Verify</MudButton>
|
||||
</MudItem>
|
||||
</MudGrid>
|
||||
</EditForm>
|
||||
</li>
|
||||
</ol>
|
||||
<h3>Configure authenticator app</h3>
|
||||
<div>
|
||||
<p>To use an authenticator app go through the following steps:</p>
|
||||
<ol class="list">
|
||||
<li>
|
||||
<p>
|
||||
Download a two-factor authenticator app like Microsoft Authenticator for
|
||||
<a href="https://go.microsoft.com/fwlink/?Linkid=825072">Android</a> and
|
||||
<a href="https://go.microsoft.com/fwlink/?Linkid=825073">iOS</a> or
|
||||
Google Authenticator for
|
||||
<a href="https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2&hl=en">Android</a> and
|
||||
<a href="https://itunes.apple.com/us/app/google-authenticator/id388497605?mt=8">iOS</a>.
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Scan the QR Code or enter this key <kbd>@sharedKey</kbd> into your two factor authenticator app. Spaces and casing do not matter.</p>
|
||||
<div class="alert alert-info">Learn how to <a href="https://go.microsoft.com/fwlink/?Linkid=852423">enable QR code generation</a>.</div>
|
||||
<div></div>
|
||||
<div data-url="@authenticatorUri"></div>
|
||||
</li>
|
||||
<li>
|
||||
<p>
|
||||
Once you have scanned the QR code or input the key above, your two factor authentication app will provide you
|
||||
with a unique code. Enter the code in the confirmation box below.
|
||||
</p>
|
||||
<div class="row">
|
||||
<div class="col-xl-6">
|
||||
<EditForm Model="Input" FormName="send-code" OnValidSubmit="OnValidSubmitAsync" method="post">
|
||||
<DataAnnotationsValidator />
|
||||
<div class="form-floating mb-3">
|
||||
<InputText @bind-Value="Input.Code" id="Input.Code" class="form-control" autocomplete="off" placeholder="Enter the code" />
|
||||
<label for="Input.Code" class="control-label form-label">Verification Code</label>
|
||||
<ValidationMessage For="() => Input.Code" class="text-danger" />
|
||||
</div>
|
||||
<button type="submit" class="w-100 btn btn-lg btn-primary">Verify</button>
|
||||
<ValidationSummary class="text-danger" role="alert" />
|
||||
</EditForm>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
}
|
||||
|
||||
@code {
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
@using Microsoft.AspNetCore.Authentication
|
||||
@using Microsoft.AspNetCore.Identity
|
||||
@using OpenArchival.Blazor.Data
|
||||
@using MyAppName.WebApp.Components.Account
|
||||
@using OpenArchival.DataAccess
|
||||
|
||||
@inject UserManager<ApplicationUser> UserManager
|
||||
@inject SignInManager<ApplicationUser> SignInManager
|
||||
@@ -47,7 +48,7 @@
|
||||
@if (otherLogins?.Count > 0)
|
||||
{
|
||||
<h4>Add another service to log in.</h4>
|
||||
<MudDivider />
|
||||
<hr />
|
||||
<form class="form-horizontal" action="Account/Manage/LinkExternalLogin" method="post">
|
||||
<AntiforgeryToken />
|
||||
<div>
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
@page "/Account/Manage/GenerateRecoveryCodes"
|
||||
|
||||
@using Microsoft.AspNetCore.Identity
|
||||
@using OpenArchival.Blazor.Data
|
||||
@using MyAppName.WebApp.Components.Account
|
||||
@using OpenArchival.DataAccess
|
||||
|
||||
@inject UserManager<ApplicationUser> UserManager
|
||||
@inject IdentityUserAccessor UserAccessor
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
@using System.ComponentModel.DataAnnotations
|
||||
@using Microsoft.AspNetCore.Identity
|
||||
@using OpenArchival.Blazor.Data
|
||||
@using MyAppName.WebApp.Components.Account
|
||||
@using OpenArchival.DataAccess
|
||||
|
||||
@inject UserManager<ApplicationUser> UserManager
|
||||
@inject SignInManager<ApplicationUser> SignInManager
|
||||
@@ -11,27 +12,27 @@
|
||||
|
||||
<PageTitle>Profile</PageTitle>
|
||||
|
||||
<MudText Typo="Typo.h6" GutterBottom="true">Profile</MudText>
|
||||
|
||||
<h3>Profile</h3>
|
||||
<StatusMessage />
|
||||
|
||||
<EditForm Model="Input" FormName="profile" OnValidSubmit="OnValidSubmitAsync" method="post">
|
||||
<DataAnnotationsValidator />
|
||||
|
||||
<MudGrid>
|
||||
<MudItem md="12">
|
||||
<MudTextField Value="@username" Label="Username" Disabled="true" Placeholder="Please choose your username." />
|
||||
</MudItem>
|
||||
<MudItem md="12">
|
||||
<MudTextField For="@(() => Input.PhoneNumber)" @bind-Value="Input.PhoneNumber"
|
||||
Label="Phone Number" HelperText="Please enter your phone number."
|
||||
UserAttributes="@(new() { { "autocomplete", "tel-national" } } )" />
|
||||
</MudItem>
|
||||
<MudItem md="12">
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Primary" FullWidth="true" FormAction="FormAction.Submit">Save</MudButton>
|
||||
</MudItem>
|
||||
</MudGrid>
|
||||
</EditForm>
|
||||
<div class="row">
|
||||
<div class="col-xl-6">
|
||||
<EditForm Model="Input" FormName="profile" OnValidSubmit="OnValidSubmitAsync" method="post">
|
||||
<DataAnnotationsValidator />
|
||||
<ValidationSummary class="text-danger" role="alert" />
|
||||
<div class="form-floating mb-3">
|
||||
<input type="text" value="@username" id="username" class="form-control" placeholder="Choose your username." disabled />
|
||||
<label for="username" class="form-label">Username</label>
|
||||
</div>
|
||||
<div class="form-floating mb-3">
|
||||
<InputText @bind-Value="Input.PhoneNumber" id="Input.PhoneNumber" class="form-control" placeholder="Enter your phone number" />
|
||||
<label for="Input.PhoneNumber" class="form-label">Phone number</label>
|
||||
<ValidationMessage For="() => Input.PhoneNumber" class="text-danger" />
|
||||
</div>
|
||||
<button type="submit" class="w-100 btn btn-lg btn-primary">Save</button>
|
||||
</EditForm>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
private ApplicationUser user = default!;
|
||||
|
||||
@@ -1,34 +1,28 @@
|
||||
@page "/Account/Manage/PersonalData"
|
||||
@using MyAppName.WebApp.Components.Account
|
||||
|
||||
@inject IdentityUserAccessor UserAccessor
|
||||
|
||||
<PageTitle>Personal Data</PageTitle>
|
||||
|
||||
<MudText Typo="Typo.h6" GutterBottom="true">Personal data</MudText>
|
||||
|
||||
<StatusMessage />
|
||||
<h3>Personal Data</h3>
|
||||
|
||||
<MudGrid>
|
||||
<MudItem md="12">
|
||||
<MudText Typo="Typo.body1">
|
||||
Your account contains personal data that you have given us. This page allows you to download or delete that data.
|
||||
</MudText>
|
||||
</MudItem>
|
||||
<MudItem md="12">
|
||||
<MudAlert Severity="Severity.Warning" Variant="Variant.Text">
|
||||
Deleting this data will permanently remove your account, and this cannot be recovered.
|
||||
</MudAlert>
|
||||
</MudItem>
|
||||
<MudItem md="12">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<p>Your account contains personal data that you have given us. This page allows you to download or delete that data.</p>
|
||||
<p>
|
||||
<strong>Deleting this data will permanently remove your account, and this cannot be recovered.</strong>
|
||||
</p>
|
||||
<form action="Account/Manage/DownloadPersonalData" method="post">
|
||||
<AntiforgeryToken />
|
||||
<MudStaticButton Variant="Variant.Filled" Color="Color.Primary" FullWidth="true" FormAction="FormAction.Submit">Download</MudStaticButton>
|
||||
<button class="btn btn-primary" type="submit">Download</button>
|
||||
</form>
|
||||
</MudItem>
|
||||
<MudItem md="12">
|
||||
<MudLink Href="Account/Manage/DeletePersonalData" Color="Color.Error">Delete</MudLink>
|
||||
</MudItem>
|
||||
</MudGrid>
|
||||
<p>
|
||||
<a href="Account/Manage/DeletePersonalData" class="btn btn-danger">Delete</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
[CascadingParameter]
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
@page "/Account/Manage/ResetAuthenticator"
|
||||
|
||||
@using Microsoft.AspNetCore.Identity
|
||||
@using OpenArchival.Blazor.Data
|
||||
@using MyAppName.WebApp.Components.Account
|
||||
@using OpenArchival.DataAccess
|
||||
|
||||
@inject UserManager<ApplicationUser> UserManager
|
||||
@inject SignInManager<ApplicationUser> SignInManager
|
||||
@@ -11,24 +12,24 @@
|
||||
|
||||
<PageTitle>Reset authenticator key</PageTitle>
|
||||
|
||||
<MudText Typo="Typo.h6" GutterBottom="true">Reset authenticator key</MudText>
|
||||
|
||||
<StatusMessage />
|
||||
|
||||
<MudAlert Severity="Severity.Warning" Variant="Variant.Text">
|
||||
If you reset your authenticator key your authenticator app will not work until you reconfigure it.
|
||||
</MudAlert>
|
||||
|
||||
<MudText Typo="Typo.body2" Class="my-4">
|
||||
This process disables 2FA until you verify your authenticator app.
|
||||
If you do not complete your authenticator app configuration you may lose access to your account.
|
||||
</MudText>
|
||||
|
||||
<form @formname="reset-authenticator" @onsubmit="OnSubmitAsync" method="post">
|
||||
<AntiforgeryToken />
|
||||
|
||||
<MudStaticButton Variant="Variant.Filled" Color="Color.Primary" FullWidth="true" FormAction="FormAction.Submit">Reset authenticator key</MudStaticButton>
|
||||
</form>
|
||||
<h3>Reset authenticator key</h3>
|
||||
<div class="alert alert-warning" role="alert">
|
||||
<p>
|
||||
<span class="glyphicon glyphicon-warning-sign"></span>
|
||||
<strong>If you reset your authenticator key your authenticator app will not work until you reconfigure it.</strong>
|
||||
</p>
|
||||
<p>
|
||||
This process disables 2FA until you verify your authenticator app.
|
||||
If you do not complete your authenticator app configuration you may lose access to your account.
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<form @formname="reset-authenticator" @onsubmit="OnSubmitAsync" method="post">
|
||||
<AntiforgeryToken />
|
||||
<button class="btn btn-danger" type="submit">Reset authenticator key</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
[CascadingParameter]
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
@using System.ComponentModel.DataAnnotations
|
||||
@using Microsoft.AspNetCore.Identity
|
||||
@using OpenArchival.Blazor.Data
|
||||
@using MyAppName.WebApp.Components.Account
|
||||
@using OpenArchival.DataAccess
|
||||
|
||||
@inject UserManager<ApplicationUser> UserManager
|
||||
@inject SignInManager<ApplicationUser> SignInManager
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
@using Microsoft.AspNetCore.Http.Features
|
||||
@using Microsoft.AspNetCore.Identity
|
||||
@using OpenArchival.Blazor.Data
|
||||
@using MyAppName.WebApp.Components.Account
|
||||
@using OpenArchival.DataAccess
|
||||
|
||||
@inject UserManager<ApplicationUser> UserManager
|
||||
@inject SignInManager<ApplicationUser> SignInManager
|
||||
@@ -11,72 +12,63 @@
|
||||
|
||||
<PageTitle>Two-factor authentication (2FA)</PageTitle>
|
||||
|
||||
<MudText Typo="Typo.h6" GutterBottom="true">Two-factor authentication (2FA)</MudText>
|
||||
|
||||
<StatusMessage />
|
||||
|
||||
<h3>Two-factor authentication (2FA)</h3>
|
||||
@if (canTrack)
|
||||
{
|
||||
if (is2faEnabled)
|
||||
{
|
||||
if (recoveryCodesLeft == 0)
|
||||
{
|
||||
<MudAlert Variant="Variant.Text" Severity="Severity.Error">You have no recovery codes left.</MudAlert>
|
||||
|
||||
<MudText Typo="Typo.body1" Class="pt-4">
|
||||
You must <MudLink Href="Account/Manage/GenerateRecoveryCodes">generate a new set of recovery codes</MudLink>
|
||||
before you can log in with a recovery code.
|
||||
</MudText>
|
||||
<div class="alert alert-danger">
|
||||
<strong>You have no recovery codes left.</strong>
|
||||
<p>You must <a href="Account/Manage/GenerateRecoveryCodes">generate a new set of recovery codes</a> before you can log in with a recovery code.</p>
|
||||
</div>
|
||||
}
|
||||
else if (recoveryCodesLeft == 1)
|
||||
{
|
||||
<MudAlert Variant="Variant.Text" Severity="Severity.Warning">You have 1 recovery code left.</MudAlert>
|
||||
|
||||
<MudText Typo="Typo.body1" Class="pt-4">
|
||||
You can <MudLink Href="Account/Manage/GenerateRecoveryCodes">generate a new set of recovery codes</MudLink>.
|
||||
</MudText>
|
||||
<div class="alert alert-danger">
|
||||
<strong>You have 1 recovery code left.</strong>
|
||||
<p>You can <a href="Account/Manage/GenerateRecoveryCodes">generate a new set of recovery codes</a>.</p>
|
||||
</div>
|
||||
}
|
||||
else if (recoveryCodesLeft <= 3)
|
||||
{
|
||||
<MudAlert Variant="Variant.Text" Severity="Severity.Warning">You have @recoveryCodesLeft recovery codes left.</MudAlert>
|
||||
|
||||
<MudText Typo="Typo.body1" Class="pt-4">
|
||||
You should <MudLink Href="Account/Manage/GenerateRecoveryCodes">generate a new set of recovery codes</MudLink>.
|
||||
</MudText>
|
||||
<div class="alert alert-warning">
|
||||
<strong>You have @recoveryCodesLeft recovery codes left.</strong>
|
||||
<p>You should <a href="Account/Manage/GenerateRecoveryCodes">generate a new set of recovery codes</a>.</p>
|
||||
</div>
|
||||
}
|
||||
|
||||
if (isMachineRemembered)
|
||||
{
|
||||
<form style="display: inline-block" @formname="forget-browser" @onsubmit="OnSubmitForgetBrowserAsync" method="post">
|
||||
<AntiforgeryToken />
|
||||
|
||||
<MudStaticButton Variant="Variant.Filled" Color="Color.Primary" FullWidth="true" FormAction="FormAction.Submit">Forget this browser</MudStaticButton>
|
||||
<button type="submit" class="btn btn-primary">Forget this browser</button>
|
||||
</form>
|
||||
}
|
||||
|
||||
<MudLink Href="Account/Manage/Disable2fa">Disable 2FA</MudLink><br />
|
||||
<MudLink Href="Account/Manage/GenerateRecoveryCodes">Reset recovery codes</MudLink>
|
||||
<a href="Account/Manage/Disable2fa" class="btn btn-primary">Disable 2FA</a>
|
||||
<a href="Account/Manage/GenerateRecoveryCodes" class="btn btn-primary">Reset recovery codes</a>
|
||||
}
|
||||
|
||||
<MudText Typo="Typo.h6" GutterBottom="true">Authenticator app</MudText>
|
||||
|
||||
<h4>Authenticator app</h4>
|
||||
@if (!hasAuthenticator)
|
||||
{
|
||||
<MudLink Href="Account/Manage/EnableAuthenticator">Add authenticator app</MudLink><br />
|
||||
<a href="Account/Manage/EnableAuthenticator" class="btn btn-primary">Add authenticator app</a>
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudLink Href="Account/Manage/EnableAuthenticator">Set up authenticator app</MudLink><br />
|
||||
<MudLink Href="Account/Manage/ResetAuthenticator">Reset authenticator app</MudLink>
|
||||
<a href="Account/Manage/EnableAuthenticator" class="btn btn-primary">Set up authenticator app</a>
|
||||
<a href="Account/Manage/ResetAuthenticator" class="btn btn-primary">Reset authenticator app</a>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudAlert Variant="Variant.Text" Severity="Severity.Error">Privacy and cookie policy have not been accepted.</MudAlert>
|
||||
|
||||
<MudText Typo="Typo.body1" Class="pt-4">
|
||||
You must accept the policy before you can enable two factor authentication.
|
||||
</MudText>
|
||||
<div class="alert alert-danger">
|
||||
<strong>Privacy and cookie policy have not been accepted.</strong>
|
||||
<p>You must accept the policy before you can enable two factor authentication.</p>
|
||||
</div>
|
||||
}
|
||||
|
||||
@code {
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
@layout ManageLayout
|
||||
@using OpenArchival.Blazor.Components.Account.Shared
|
||||
@layout ManageLayout
|
||||
@attribute [Microsoft.AspNetCore.Authorization.Authorize]
|
||||
|
||||
Reference in New Issue
Block a user