auth fixes
This commit is contained in:
parent
c61e413ebb
commit
06a1fc4cfb
|
|
@ -115,7 +115,7 @@
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_logger.Info("No token stored yet");
|
_logger.Info("No token stored yet");
|
||||||
NavManager.NavigateTo("/");
|
//NavManager.NavigateTo("/");
|
||||||
}
|
}
|
||||||
ComponentUpdateService.CallRequestRefresh();
|
ComponentUpdateService.CallRequestRefresh();
|
||||||
|
|
||||||
|
|
@ -133,6 +133,7 @@
|
||||||
var userBasicDetail = JsonConvert.DeserializeObject<UserBasicDetails>(userDetailsStr);
|
var userBasicDetail = JsonConvert.DeserializeObject<UserBasicDetails>(userDetailsStr);
|
||||||
|
|
||||||
UserDataService.Logout(userBasicDetail.RefreshToken);
|
UserDataService.Logout(userBasicDetail.RefreshToken);
|
||||||
|
AuthStateProvider.GetAuthenticationStateAsync();
|
||||||
SecureStorageHandler.ClearAllSecureStorageAsync();
|
SecureStorageHandler.ClearAllSecureStorageAsync();
|
||||||
sessionService.User = null;
|
sessionService.User = null;
|
||||||
sessionService.IsAuthenticated = false;
|
sessionService.IsAuthenticated = false;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
@page "/chat"
|
@page "/chat"
|
||||||
|
@using Microsoft.AspNetCore.Authorization
|
||||||
@using TIAMWebApp.Shared.Application.Services
|
@using TIAMWebApp.Shared.Application.Services
|
||||||
@inject SignalRService SignalRService
|
@inject SignalRService SignalRService
|
||||||
|
@attribute [Authorize]
|
||||||
<h3>Chat</h3>
|
<h3>Chat</h3>
|
||||||
<div class="container mt-5">
|
<div class="container mt-5">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,8 @@ using TIAMWebApp.Shared.Application.Utility;
|
||||||
using TIAMSharedUI.Pages.Components;
|
using TIAMSharedUI.Pages.Components;
|
||||||
using TIAMWebApp.Shared.Application.Models.ClientSide;
|
using TIAMWebApp.Shared.Application.Models.ClientSide;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using Microsoft.AspNetCore.Components.Authorization;
|
||||||
|
|
||||||
|
|
||||||
namespace TIAMSharedUI.Shared.Components
|
namespace TIAMSharedUI.Shared.Components
|
||||||
{
|
{
|
||||||
|
|
@ -41,6 +43,8 @@ namespace TIAMSharedUI.Shared.Components
|
||||||
[Inject]
|
[Inject]
|
||||||
private IUserDataService UserDataService { get; set; }
|
private IUserDataService UserDataService { get; set; }
|
||||||
|
|
||||||
|
[Inject] AuthenticationStateProvider AuthStateProvider { get; set; }
|
||||||
|
|
||||||
private bool enableLogin = true;
|
private bool enableLogin = true;
|
||||||
private bool enableEvents = false;
|
private bool enableEvents = false;
|
||||||
private bool enableTransfer = true;
|
private bool enableTransfer = true;
|
||||||
|
|
@ -88,7 +92,7 @@ namespace TIAMSharedUI.Shared.Components
|
||||||
var userBasicDetail = JsonConvert.DeserializeObject<UserBasicDetails>(userDetailsStr);
|
var userBasicDetail = JsonConvert.DeserializeObject<UserBasicDetails>(userDetailsStr);
|
||||||
serverResult = await UserDataService.Logout(userBasicDetail.RefreshToken);
|
serverResult = await UserDataService.Logout(userBasicDetail.RefreshToken);
|
||||||
}
|
}
|
||||||
|
await AuthStateProvider.GetAuthenticationStateAsync();
|
||||||
await SecureStorageHandler.ClearAllSecureStorageAsync();
|
await SecureStorageHandler.ClearAllSecureStorageAsync();
|
||||||
sessionService.User = null;
|
sessionService.User = null;
|
||||||
sessionService.IsAuthenticated = false;
|
sessionService.IsAuthenticated = false;
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,10 @@
|
||||||
<Found Context="routeData">
|
<Found Context="routeData">
|
||||||
<AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)">
|
<AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)">
|
||||||
<NotAuthorized>
|
<NotAuthorized>
|
||||||
<p>Sorry dude, but you're not authorized!</p>
|
<div class="text-center m-5">
|
||||||
|
<h1>Restricted area</h1>
|
||||||
|
<h2 style="font-size:small">Sorry, you are not authorized to view this!</h2>
|
||||||
|
</div>
|
||||||
</NotAuthorized>
|
</NotAuthorized>
|
||||||
</AuthorizeRouteView>
|
</AuthorizeRouteView>
|
||||||
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
|
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
|
||||||
|
|
@ -25,7 +28,10 @@
|
||||||
<NotFound>
|
<NotFound>
|
||||||
<PageTitle>Not found</PageTitle>
|
<PageTitle>Not found</PageTitle>
|
||||||
<LayoutView Layout="@typeof(MainLayout)">
|
<LayoutView Layout="@typeof(MainLayout)">
|
||||||
<p role="alert">Sorry, there's nothing at this address.</p>
|
<div class="text-center m-5">
|
||||||
|
<h1>Oops...</h1>
|
||||||
|
<h2 style="font-size:small">Sorry, we can't find the content you asked for!</h2>
|
||||||
|
</div>
|
||||||
</LayoutView>
|
</LayoutView>
|
||||||
</NotFound>
|
</NotFound>
|
||||||
</Router>
|
</Router>
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ using TIAMWebApp.Shared.Application.Models;
|
||||||
using TIAMWebApp.Shared.Application.Models.ClientSide.Messages;
|
using TIAMWebApp.Shared.Application.Models.ClientSide.Messages;
|
||||||
using TIAMWebApp.Shared.Application.Services;
|
using TIAMWebApp.Shared.Application.Services;
|
||||||
using TIAMWebApp.Server.Services;
|
using TIAMWebApp.Server.Services;
|
||||||
|
using TIAMWebApp.Shared.Application.Models.ClientSide;
|
||||||
|
|
||||||
namespace TIAMWebApp.Server.Controllers
|
namespace TIAMWebApp.Server.Controllers
|
||||||
{
|
{
|
||||||
|
|
@ -350,7 +351,7 @@ namespace TIAMWebApp.Server.Controllers
|
||||||
<p>{createdTransfer.FullName}</p>
|
<p>{createdTransfer.FullName}</p>
|
||||||
<p>{createdTransfer.PassengerCount}</p>
|
<p>{createdTransfer.PassengerCount}</p>
|
||||||
<p>Please confirm the transfer by clicking on the following link:</p>
|
<p>Please confirm the transfer by clicking on the following link:</p>
|
||||||
<p><a href=""https://www.touriam.com/mytransfer?{createdTransfer.Id}"">Confirm Transfer</a></p>
|
<p><a href=""https://{Setting.BaseUrl}/mytransfers/{createdTransfer.Id}"">Confirm Transfer</a></p>
|
||||||
<p>If you did not request this transfer, please disregard this email.</p>
|
<p>If you did not request this transfer, please disregard this email.</p>
|
||||||
<p>Thank you,<br/>Tour I Am team</p>
|
<p>Thank you,<br/>Tour I Am team</p>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue