Sikeres POST az eszközről
This commit is contained in:
@@ -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");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user