86 lines
4.2 KiB
Plaintext
86 lines
4.2 KiB
Plaintext
@page "/web/auth/challenge/{id:guid}/verify/{factorId:guid}"
|
|
@using DysonNetwork.Sphere.Account
|
|
@model DysonNetwork.Sphere.Pages.Auth.VerifyFactorModel
|
|
@{
|
|
ViewData["Title"] = "Verify Your Identity";
|
|
}
|
|
|
|
<div class="hero min-h-full bg-base-200">
|
|
<div class="hero-content w-full max-w-md">
|
|
<div class="card w-full bg-base-100 shadow-xl">
|
|
<div class="card-body px-8 py-7">
|
|
<h1 class="card-title justify-center text-2xl font-bold">Verify Your Identity</h1>
|
|
<p class="text-center">
|
|
@switch (Model.FactorType)
|
|
{
|
|
case AccountAuthFactorType.EmailCode:
|
|
<span>We've sent a verification code to your email.</span>
|
|
break;
|
|
case AccountAuthFactorType.InAppCode:
|
|
<span>Enter the code from your authenticator app.</span>
|
|
break;
|
|
case AccountAuthFactorType.TimedCode:
|
|
<span>Enter your time-based verification code.</span>
|
|
break;
|
|
case AccountAuthFactorType.PinCode:
|
|
<span>Enter your PIN code.</span>
|
|
break;
|
|
case AccountAuthFactorType.Password:
|
|
<span>Enter your password.</span>
|
|
break;
|
|
default:
|
|
<span>Please verify your identity.</span>
|
|
break;
|
|
}
|
|
</p>
|
|
|
|
@if (Model.AuthChallenge == null)
|
|
{
|
|
<div class="alert alert-error">
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="stroke-current shrink-0 h-6 w-6" fill="none" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z" /></svg>
|
|
<span>Challenge not found or expired.</span>
|
|
</div>
|
|
}
|
|
else if (Model.AuthChallenge.StepRemain == 0)
|
|
{
|
|
<div class="alert alert-success">
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="stroke-current shrink-0 h-6 w-6" fill="none" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" /></svg>
|
|
<span>Verification successful. Redirecting...</span>
|
|
</div>
|
|
}
|
|
else
|
|
{
|
|
<form method="post" class="space-y-4">
|
|
<div asp-validation-summary="ModelOnly" class="text-error text-sm"></div>
|
|
|
|
<div class="form-control">
|
|
<label asp-for="Code" class="label">
|
|
<span class="label-text">@(Model.FactorType == AccountAuthFactorType.Password ? "Use your password" : "Verification Code")</span>
|
|
</label>
|
|
<input asp-for="Code"
|
|
class="input input-bordered w-full"
|
|
autocomplete="one-time-code"
|
|
type="password"
|
|
autofocus />
|
|
<span asp-validation-for="Code" class="text-error text-sm mt-1"></span>
|
|
</div>
|
|
|
|
<div class="form-control mt-6">
|
|
<button type="submit" class="btn btn-primary w-full">Verify</button>
|
|
</div>
|
|
|
|
<div class="text-center mt-4">
|
|
<a asp-page="SelectFactor" asp-route-id="@Model.Id" class="link link-primary text-sm">
|
|
← Back to authentication methods
|
|
</a>
|
|
</div>
|
|
</form>
|
|
}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
@section Scripts {
|
|
@{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); }
|
|
} |