Add OtpDialogService for mobile-friendly OTP authentication dialog
This commit is contained in:
@@ -48,7 +48,6 @@ public partial class AuthDialog : IDisposable
|
||||
|
||||
[Inject] private ILocalStorageService LocalStorage { get; set; } = default!;
|
||||
[Inject] private UserContract.UserContractClient UserClient { get; set; } = default!;
|
||||
[Inject] private AuthService AuthService { get; set; } = default!;
|
||||
|
||||
[CascadingParameter]
|
||||
private IMudDialogInstance MudDialog { get; set; }
|
||||
@@ -66,7 +65,6 @@ public partial class AuthDialog : IDisposable
|
||||
// {
|
||||
GenerateCaptcha();
|
||||
// }
|
||||
|
||||
var storedPhone = await LocalStorage.GetItemAsync<string>(PhoneStorageKey);
|
||||
if (!string.IsNullOrWhiteSpace(storedPhone))
|
||||
{
|
||||
@@ -227,22 +225,14 @@ public partial class AuthDialog : IDisposable
|
||||
_attemptsLeft = MaxVerificationAttempts;
|
||||
_verifyRequest.Code = string.Empty;
|
||||
|
||||
await OnLoginSuccess.InvokeAsync();
|
||||
|
||||
|
||||
if (!InlineMode)
|
||||
{
|
||||
MudDialog?.Close();
|
||||
}
|
||||
if (await AuthService.IsAuthenticatedAsync())
|
||||
{
|
||||
if (!(await AuthService.IsCompleteRegisterAsync()))
|
||||
{
|
||||
Navigation.NavigateTo(RouteConstants.Registration.Wizard);
|
||||
}
|
||||
else
|
||||
{
|
||||
Navigation.NavigateTo(RouteConstants.Profile.Index);
|
||||
}
|
||||
}
|
||||
await OnLoginSuccess.InvokeAsync();
|
||||
// await OnLoginSuccessAsync();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -270,6 +260,7 @@ public partial class AuthDialog : IDisposable
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
private async Task HandleVerificationFailureAsync(RpcException rpcEx)
|
||||
{
|
||||
switch (rpcEx.Status.StatusCode)
|
||||
|
||||
Reference in New Issue
Block a user