u
This commit is contained in:
@@ -13,24 +13,23 @@ public partial class App
|
||||
|
||||
private async Task HandleNavigationAsync(NavigationContext context)
|
||||
{
|
||||
// Temporarily bypass authentication to test profile page
|
||||
// var normalizedPath = NormalizePath(context.Path);
|
||||
// if (IsAuthPath(normalizedPath))
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
var normalizedPath = NormalizePath(context.Path);
|
||||
if (IsAuthPath(normalizedPath))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// var token = await LocalStorage.GetItemAsync<string>(TokenStorageKey);
|
||||
// if (!string.IsNullOrWhiteSpace(token))
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
var token = await LocalStorage.GetItemAsync<string>(TokenStorageKey);
|
||||
if (!string.IsNullOrWhiteSpace(token))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// var redirect = string.IsNullOrEmpty(normalizedPath) || normalizedPath == "/"
|
||||
// ? string.Empty
|
||||
// : $"?redirect={Uri.EscapeDataString(normalizedPath)}";
|
||||
var redirect = string.IsNullOrEmpty(normalizedPath) || normalizedPath == "/"
|
||||
? string.Empty
|
||||
: $"?redirect={Uri.EscapeDataString(normalizedPath)}";
|
||||
|
||||
// Navigation.NavigateTo(RouteConstants.Auth.Phone + redirect, forceLoad: true);
|
||||
Navigation.NavigateTo(RouteConstants.Auth.Phone + redirect, forceLoad: true);
|
||||
}
|
||||
|
||||
private static bool IsAuthPath(string? path)
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
<MudLink Href="#pricing" Typo="Typo.subtitle1" Class="mud-link">قیمتها</MudLink>
|
||||
<MudLink Href="#faq" Typo="Typo.subtitle1" Class="mud-link">سوالات متداول</MudLink>
|
||||
<MudLink Href="#contact" Typo="Typo.subtitle1" Class="mud-link">ارتباط با ما</MudLink>
|
||||
<MudLink Href="/profile" Typo="Typo.subtitle1" Class="mud-link">پروفایل</MudLink>
|
||||
</div>
|
||||
|
||||
<div class="d-flex align-center gap-2">
|
||||
@@ -56,6 +57,7 @@
|
||||
<MudLink Href="#pricing" Typo="Typo.subtitle1" OnClick="() => _drawerOpen=false">قیمتها</MudLink>
|
||||
<MudLink Href="#faq" Typo="Typo.subtitle1" OnClick="() => _drawerOpen=false">سوالات متداول</MudLink>
|
||||
<MudLink Href="#contact" Typo="Typo.subtitle1" OnClick="() => _drawerOpen=false">ارتباط</MudLink>
|
||||
<MudLink Href="/profile" Typo="Typo.subtitle1" OnClick="() => _drawerOpen=false">پروفایل</MudLink>
|
||||
<MudDivider Class="my-2" />
|
||||
<MudButton Variant="Variant.Outlined" Color="Color.Inherit">ورود</MudButton>
|
||||
<MudButton Color="Color.Primary">شروع کنید</MudButton>
|
||||
|
||||
Reference in New Issue
Block a user