28 lines
736 B
C#
28 lines
736 B
C#
using CORP_MAUI.Pages;
|
|
|
|
namespace CORP_MAUI;
|
|
|
|
public partial class App : Application
|
|
{
|
|
public App()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
protected override Window CreateWindow(IActivationState? activationState)
|
|
{
|
|
// Проверяем, есть ли сохраненный токен
|
|
var hasToken = SecureStorage.Default.GetAsync("auth_token").Result != null;
|
|
|
|
if (hasToken)
|
|
{
|
|
// Пользователь уже вошел в систему
|
|
return new Window(new AppShell());
|
|
}
|
|
else
|
|
{
|
|
// Показываем страницу входа
|
|
return new Window(new NavigationPage(new LoginPage()));
|
|
}
|
|
}
|
|
} |