This commit is contained in:
MeysamMoghaddam
2025-10-07 01:03:58 +03:30
parent e357c1802b
commit 7be59c3ec3
5 changed files with 608 additions and 14 deletions
+15 -14
View File
@@ -13,23 +13,24 @@ public partial class App
private async Task HandleNavigationAsync(NavigationContext context)
{
var normalizedPath = NormalizePath(context.Path);
if (IsAuthPath(normalizedPath))
{
return;
}
// Temporarily bypass authentication to test profile page
// 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)