* Added Authorization which is not working
This commit is contained in:
@@ -1,4 +1,9 @@
|
||||
@page "/login"
|
||||
|
||||
@rendermode InteractiveServer
|
||||
@attribute [AllowAnonymous]
|
||||
|
||||
@using Microsoft.AspNetCore.Authorization
|
||||
@using Microsoft.AspNetCore.Components.Authorization
|
||||
@using OrdersManagement.Models
|
||||
@using Syncfusion.Blazor.Inputs
|
||||
@@ -102,18 +107,18 @@
|
||||
{
|
||||
Console.WriteLine($"Próba logowania dla: {LoginModel.Login}");
|
||||
var user = await UserService.AuthenticateUserAsync(LoginModel.Login, LoginModel.Password);
|
||||
|
||||
if (user != null)
|
||||
{
|
||||
Console.WriteLine($"Użytkownik {user.Login} znaleziony.");
|
||||
if (user.IsTemporaryPassword)
|
||||
{
|
||||
ShowChangePassword = true;
|
||||
StateHasChanged(); // Wymagane, aby odświeżyć UI
|
||||
StateHasChanged();
|
||||
}
|
||||
else
|
||||
{
|
||||
await ((CustomAuthenticationStateProvider)AuthenticationStateProvider).MarkUserAsAuthenticated(user);
|
||||
NavigationManager.NavigateTo("/");
|
||||
NavigationManager.NavigateTo("/ScheduleOrders");
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user