Kashub's Code Barn - "asd"

podświetlone jako plsql (dodał(a) asd @ 2023-01-12 13:09:45)

Twoja wyszukiwarka
Podświetl ten kod w:
Ostatnio dodane:
Losowe wpisy:
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
using ApprovementWorkflowSample.Applications;
using Microsoft.AspNetCore.Identity;
using System.Security.Claims;
using Microsoft.AspNetCore.Components.Authorization;
using Microsoft.AspNetCore.Authentication.Cookies;
 
namespace ApprovementWorkflowSample.Views
{
    PUBLIC partial class SignIn
    {
        [Inject]
        PUBLIC IJSRuntime? JSRuntime { get; init; }
        [Inject]
        PUBLIC NavigationManager? Navigation { get; init; }
        [Inject]
        PUBLIC IApplicationUserService? ApplicationUsers{get; init; }
        [Inject]
        PUBLIC SignInManager<ApplicationUser>? SignInManager { get; init; }
        [Inject]
        PUBLIC IHostEnvironmentAuthenticationStateProvider? HostAuthentication { get; init; }
        [Inject]
        PUBLIC AuthenticationStateProvider? AuthenticationStateProvider{get; init; }
...
        PUBLIC async Task StartSigningIn()
        {
...
            ApplicationUser? USER = await ApplicationUsers!.GetUserByEmailAsync(Email);
            IF(USER == NULL)
            {
                await HandleSigningInFailedAsync("Email or Password are not match");
                RETURN;
            }
            SignInResult loginResult = await SignInManager!.CheckPasswordSignInAsync(USER, Password, FALSE);
            IF(loginResult.Succeeded == FALSE)
            {
                await HandleSigningInFailedAsync("Email or Password are not match");
                RETURN;
            }
            IF(loginResult.Succeeded)
            {
                ClaimsPrincipal principal = await SignInManager.CreateUserPrincipalAsync(USER);
                SignInManager.Context.USER = principal;
                HostAuthentication!.SetAuthenticationState(
                    Task.FromResult(NEW AuthenticationState(principal)));
 
                // IF you don't need doing anything without moving to next page, you can remove this.
                AuthenticationState authState = await AuthenticationStateProvider!.GetAuthenticationStateAsync();
 
                Navigation!.NavigateTo("/Pages/Edit");
            }
        }
| Sklepy internetowe | | Sklep z artykułami dla dzieci | | Opony letnie | | Kamery IP sklep | | Sklep z artykułami dla zwierząt | | Programista Trójmiasto | | Skróć link | | Blog o książkach | | Darmowe Blogi | | Załóż za darmo bloga |