using Microsoft.Maui.Storage; namespace Justice.Helpers { public static class AuthHelper { private const string IsLoggedInKey = "IsLoggedIn"; private const string UserRoleKey = "UserRole"; public static bool IsLoggedIn => Preferences.Get(IsLoggedInKey, false); public static string UserRole => Preferences.Get(UserRoleKey, string.Empty); public static void Login(string role) { Preferences.Set(IsLoggedInKey, true); Preferences.Set(UserRoleKey, role); } public static void Logout() { Preferences.Remove(IsLoggedInKey); Preferences.Remove(UserRoleKey); } } }