Sikeres POST az eszközről

This commit is contained in:
2025-01-24 11:15:17 +01:00
parent 862f0a148b
commit 0d44cd48fb
7 changed files with 82 additions and 18 deletions
@@ -1,3 +1,4 @@
using WorkFlowCheck.MAUI.Services;
namespace WorkFlowCheck.MAUI.Pages.Security;
@@ -5,17 +6,17 @@ namespace WorkFlowCheck.MAUI.Pages.Security;
public partial class LoginPage : ContentPage
{
private readonly IUserService _userService;
public LoginPage(IUserService userService)
public LoginPage()
{
InitializeComponent();
_userService = userService;
_userService = MauiProgram.ServiceProvider.GetRequiredService<IUserService>();
}
private async void OnLoginClicked(object sender, EventArgs e)
{
// Példa bejelentkezés
bool success = _userService.Login(UsernameEntry.Text, PasswordEntry.Text);
var response = await _userService.Authenticate(UsernameEntry.Text.ToString(), PasswordEntry.Text.ToString());
if (success)
if (response != null && response.IsSuccess)
{
await DisplayAlert("Success", "You are now logged in.", "OK");