You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
786 B
32 lines
786 B
using System.Net.Http.Json;
|
|
using Biskilog_Accounting.Shared.ClientContractModels;
|
|
|
|
namespace Biskilog_Accounting.Client.Pages.Auth
|
|
{
|
|
public partial class Login
|
|
{
|
|
private Userauth m_userAuth;
|
|
private string errormessage;
|
|
|
|
protected override void OnInitialized()
|
|
{
|
|
m_userAuth = new();
|
|
base.OnInitialized();
|
|
}
|
|
public async Task AuthUser()
|
|
{
|
|
var response = await httpclient.PostAsJsonAsync("api/authentication", m_userAuth);
|
|
if (response.IsSuccessStatusCode)
|
|
{
|
|
navigationmanager.NavigateTo("/welcome");
|
|
}
|
|
else
|
|
{
|
|
errormessage = "Invalid Username or password";
|
|
}
|
|
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|