Enhance authentication flow; add user registration completion check and update contract acceptance process

This commit is contained in:
masoodafar-web
2025-11-17 00:17:10 +03:30
parent 680ef3a7e2
commit 772ed3523e
11 changed files with 536 additions and 91 deletions

View File

@@ -1,6 +1,7 @@
using Blazored.LocalStorage;
using FrontOffice.BFF.User.Protobuf.Protos.User;
using FrontOffice.BFF.User.Protobuf.Validator;
using FrontOffice.Main.Utilities;
using Grpc.Core;
using Microsoft.AspNetCore.Components;
using MudBlazor;
@@ -47,6 +48,7 @@ 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; }
@@ -230,6 +232,17 @@ public partial class AuthDialog : IDisposable
{
MudDialog?.Close();
}
if (await AuthService.IsAuthenticatedAsync())
{
if (!(await AuthService.IsCompleteRegisterAsync()))
{
Navigation.NavigateTo(RouteConstants.Registration.Wizard);
}
else
{
Navigation.NavigateTo(RouteConstants.Profile.Index);
}
}
return true;
}