Kashub's Code Barn - "asd"

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

Twoja wyszukiwarka
Parcel ABC
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");
            }
        }
| Foteliki samochodowe | | Wózki dla dzieci | | Sklep z oponami | | Opony zimowe | | Blog o książkach | | Blogi za darmo | | Załóż za darmo bloga | | Kody programów | | Skracacz linków | | Opisy GG |