Bit.Core.Identity.JwtBearerSignInManager.PasswordSignInAsync C# (CSharp) Method

PasswordSignInAsync() public method

public PasswordSignInAsync ( User user, string password, Device device = null ) : Task
user User
password string
device Device
return Task
        public async Task<JwtBearerSignInResult> PasswordSignInAsync(User user, string password, Device device = null)
        {
            if(user == null)
            {
                throw new ArgumentNullException(nameof(user));
            }

            if(await UserManager.CheckPasswordAsync(user, password))
            {
                var result = await SignInOrTwoFactorAsync(user);
                if(result.Succeeded && device != null)
                {
                    var existingDevice = await _deviceRepository.GetByIdentifierAsync(device.Identifier, user.Id);
                    if(existingDevice == null)
                    {
                        device.UserId = user.Id;
                        await _deviceRepository.CreateAsync(device);
                    }
                }

                return result;
            }

            return JwtBearerSignInResult.Failed;
        }

Same methods

JwtBearerSignInManager::PasswordSignInAsync ( string userName, string password, Device device = null ) : Task