Collins Baffour Gyawu Antwi Nana
2 years ago
4 changed files with 50 additions and 5 deletions
@ -1,7 +1,32 @@ |
|||||
namespace Biskilog_Accounting.Client.Pages.Auth |
using System.Net.Http.Json; |
||||
|
using Biskilog_Accounting.Shared.ClientContractModels; |
||||
|
|
||||
|
namespace Biskilog_Accounting.Client.Pages.Auth |
||||
{ |
{ |
||||
public partial class Login |
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"; |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
} |
} |
||||
} |
} |
||||
|
Loading…
Reference in new issue