From 862f0a148b02581d87672945facfa2149e0ee96f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szab=C3=B3=20Iv=C3=A1n?= Date: Tue, 21 Jan 2025 16:21:48 +0100 Subject: [PATCH] =?UTF-8?q?POST-os=20h=C3=ADv=C3=A1s=20tesztje=20az=20auth?= =?UTF-8?q?entik=C3=A1ci=C3=B3hoz?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/WorkFlowCheck.MAUI/App.xaml.cs | 7 ++--- src/WorkFlowCheck.MAUI/MainPage.xaml.cs | 9 +++--- src/WorkFlowCheck.MAUI/MauiProgram.cs | 4 ++- .../Pages/Security/LoginPage.xaml | 11 +++++++ .../Pages/Security/LoginPage.xaml.cs | 30 +++++++++++++++++++ .../Services/IUserService.cs | 1 + .../Services/UserService.cs | 28 ++++++++++++++--- .../WorkFlowCheck.MAUI.csproj | 6 ++++ 8 files changed, 82 insertions(+), 14 deletions(-) create mode 100644 src/WorkFlowCheck.MAUI/Pages/Security/LoginPage.xaml create mode 100644 src/WorkFlowCheck.MAUI/Pages/Security/LoginPage.xaml.cs diff --git a/src/WorkFlowCheck.MAUI/App.xaml.cs b/src/WorkFlowCheck.MAUI/App.xaml.cs index 93e166a..6f3241b 100644 --- a/src/WorkFlowCheck.MAUI/App.xaml.cs +++ b/src/WorkFlowCheck.MAUI/App.xaml.cs @@ -9,11 +9,8 @@ namespace WorkFlowCheck.MAUI { InitializeComponent(); - //MainPage = new AppShell(); - var mainPage = new MainPage(); - mainPage.Initialize(serviceProvider.GetRequiredService()); - MainPage = mainPage; - + MainPage = serviceProvider.GetRequiredService(); + } } } diff --git a/src/WorkFlowCheck.MAUI/MainPage.xaml.cs b/src/WorkFlowCheck.MAUI/MainPage.xaml.cs index 6e916b6..7aeb956 100644 --- a/src/WorkFlowCheck.MAUI/MainPage.xaml.cs +++ b/src/WorkFlowCheck.MAUI/MainPage.xaml.cs @@ -7,14 +7,15 @@ namespace WorkFlowCheck.MAUI int count = 0; private IUserService _userService; - public MainPage() + public MainPage(IUserService userService) { InitializeComponent(); - } - public void Initialize(IUserService userService) - { _userService = userService; } + //public void Initialize(IUserService userService) + //{ + // _userService = userService; + //} private void OnCounterClicked(object sender, EventArgs e) { count++; diff --git a/src/WorkFlowCheck.MAUI/MauiProgram.cs b/src/WorkFlowCheck.MAUI/MauiProgram.cs index 6e15a77..73e1622 100644 --- a/src/WorkFlowCheck.MAUI/MauiProgram.cs +++ b/src/WorkFlowCheck.MAUI/MauiProgram.cs @@ -37,7 +37,9 @@ namespace WorkFlowCheck.MAUI }); builder.Services.AddSingleton(configuration); - builder.Services.AddSingleton(); + + builder.Services.AddTransient(); + builder.Services.AddTransient(); builder .UseMauiApp() diff --git a/src/WorkFlowCheck.MAUI/Pages/Security/LoginPage.xaml b/src/WorkFlowCheck.MAUI/Pages/Security/LoginPage.xaml new file mode 100644 index 0000000..2722b98 --- /dev/null +++ b/src/WorkFlowCheck.MAUI/Pages/Security/LoginPage.xaml @@ -0,0 +1,11 @@ + + + + + +