@page "/web/auth/challenge/{id:guid}/select-factor" @using DysonNetwork.Sphere.Account @model DysonNetwork.Sphere.Pages.Auth.SelectFactorModel @{ ViewData["Title"] = "Select Authentication Method"; }

Select Authentication Method

@if (Model.AuthChallenge == null) {

Challenge not found or expired.

} else if (Model.AuthChallenge.StepRemain == 0) {

Challenge completed. Redirecting...

} else {

Please select an authentication method:

@foreach (var factor in Model.AuthFactors) {
@if (factor.Type == AccountAuthFactorType.EmailCode) {
}
}
}
@functions { private string GetFactorDisplayName(AccountAuthFactorType type) => type switch { AccountAuthFactorType.InAppCode => "Authenticator App", AccountAuthFactorType.EmailCode => "Email", AccountAuthFactorType.TimedCode => "Timed Code", AccountAuthFactorType.PinCode => "PIN Code", AccountAuthFactorType.Password => "Password", _ => type.ToString() }; private string GetFactorDescription(AccountAuthFactorType type) => type switch { AccountAuthFactorType.InAppCode => "Enter a code from your authenticator app", AccountAuthFactorType.EmailCode => "Receive a verification code via email", AccountAuthFactorType.TimedCode => "Use a time-based verification code", AccountAuthFactorType.PinCode => "Enter your PIN code", AccountAuthFactorType.Password => "Enter your password", _ => string.Empty }; }