Enhance authentication flow; add user registration completion check and update contract acceptance process
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user