This commit is contained in:
MeysamMoghaddam
2025-10-20 21:02:13 +03:30
parent 4c022f18c6
commit 59e58abaf9
2 changed files with 22 additions and 2 deletions

View File

@@ -57,4 +57,19 @@ public partial class MainLayout
{
Navigation.NavigateTo(RouteConstants.Profile.Index);
}
private async Task Logout()
{
await LocalStorage.RemoveItemAsync(TokenStorageKey);
await LocalStorage.RemoveItemAsync("auth:phone-number");
await LocalStorage.RemoveItemAsync("auth:redirect");
await LocalStorage.RemoveItemAsync("referral:code");
_isAuthenticated = false;
Snackbar.Add("با موفقیت از حساب کاربری خارج شدید.", Severity.Success);
StateHasChanged();
// Navigate to home page
Navigation.NavigateTo(RouteConstants.Main.MainPage);
}
}