diff --git a/TIAMSharedUI/Pages/AppLaunchComponent.razor b/TIAMSharedUI/Pages/AppLaunchComponent.razor index d35aa380..dbccc56b 100644 --- a/TIAMSharedUI/Pages/AppLaunchComponent.razor +++ b/TIAMSharedUI/Pages/AppLaunchComponent.razor @@ -115,7 +115,7 @@ else { _logger.Info("No token stored yet"); - NavManager.NavigateTo("/"); + //NavManager.NavigateTo("/"); } ComponentUpdateService.CallRequestRefresh(); @@ -133,6 +133,7 @@ var userBasicDetail = JsonConvert.DeserializeObject(userDetailsStr); UserDataService.Logout(userBasicDetail.RefreshToken); + AuthStateProvider.GetAuthenticationStateAsync(); SecureStorageHandler.ClearAllSecureStorageAsync(); sessionService.User = null; sessionService.IsAuthenticated = false; diff --git a/TIAMSharedUI/Pages/ChatPage.razor b/TIAMSharedUI/Pages/ChatPage.razor index 9d633a21..4fea977b 100644 --- a/TIAMSharedUI/Pages/ChatPage.razor +++ b/TIAMSharedUI/Pages/ChatPage.razor @@ -1,7 +1,8 @@ @page "/chat" +@using Microsoft.AspNetCore.Authorization @using TIAMWebApp.Shared.Application.Services @inject SignalRService SignalRService - +@attribute [Authorize]

Chat

diff --git a/TIAMSharedUI/Shared/Components/Navbar.razor.cs b/TIAMSharedUI/Shared/Components/Navbar.razor.cs index 5e7349ff..933ea38c 100644 --- a/TIAMSharedUI/Shared/Components/Navbar.razor.cs +++ b/TIAMSharedUI/Shared/Components/Navbar.razor.cs @@ -16,6 +16,8 @@ using TIAMWebApp.Shared.Application.Utility; using TIAMSharedUI.Pages.Components; using TIAMWebApp.Shared.Application.Models.ClientSide; using Newtonsoft.Json; +using Microsoft.AspNetCore.Components.Authorization; + namespace TIAMSharedUI.Shared.Components { @@ -41,6 +43,8 @@ namespace TIAMSharedUI.Shared.Components [Inject] private IUserDataService UserDataService { get; set; } + [Inject] AuthenticationStateProvider AuthStateProvider { get; set; } + private bool enableLogin = true; private bool enableEvents = false; private bool enableTransfer = true; @@ -88,8 +92,8 @@ namespace TIAMSharedUI.Shared.Components var userBasicDetail = JsonConvert.DeserializeObject(userDetailsStr); serverResult = await UserDataService.Logout(userBasicDetail.RefreshToken); } - await SecureStorageHandler.ClearAllSecureStorageAsync(); + await AuthStateProvider.GetAuthenticationStateAsync(); sessionService.User = null; sessionService.IsAuthenticated = false; navigationManager.NavigateTo("/"); diff --git a/TIAMWebApp/Client/App.razor b/TIAMWebApp/Client/App.razor index c97a5c8b..fa0ffaf1 100644 --- a/TIAMWebApp/Client/App.razor +++ b/TIAMWebApp/Client/App.razor @@ -17,7 +17,10 @@ -

Sorry dude, but you're not authorized!

+
+

Restricted area

+

Sorry, you are not authorized to view this!

+
@@ -25,7 +28,10 @@ Not found -

Sorry, there's nothing at this address.

+
+

Oops...

+

Sorry, we can't find the content you asked for!

+
diff --git a/TIAMWebApp/Server/Controllers/TransferDataAPIController.cs b/TIAMWebApp/Server/Controllers/TransferDataAPIController.cs index 1595fef0..b68adfc2 100644 --- a/TIAMWebApp/Server/Controllers/TransferDataAPIController.cs +++ b/TIAMWebApp/Server/Controllers/TransferDataAPIController.cs @@ -16,6 +16,7 @@ using TIAMWebApp.Shared.Application.Models; using TIAMWebApp.Shared.Application.Models.ClientSide.Messages; using TIAMWebApp.Shared.Application.Services; using TIAMWebApp.Server.Services; +using TIAMWebApp.Shared.Application.Models.ClientSide; namespace TIAMWebApp.Server.Controllers { @@ -350,7 +351,7 @@ namespace TIAMWebApp.Server.Controllers

{createdTransfer.FullName}

{createdTransfer.PassengerCount}

Please confirm the transfer by clicking on the following link:

-

Confirm Transfer

+

Confirm Transfer

If you did not request this transfer, please disregard this email.

Thank you,
Tour I Am team