示例#1
0
        public async Task <string> LoginUserAsync([FromBody] UserLoginWriteModel userLogin)
        {
            var user = await _userAuthDomainServiceProxy.GetUserLoginInfoAsync(userLogin.UserName);

            if (user == null || !user.IsActive)
            {
                throw new OperationException("User not found");
            }

            if (user.IsLocked)
            {
                throw new OperationException("User is locked");
            }

            await _userAuthDomainServiceProxy.PasswordSignInAsync(userLogin);

            var userToken = _oAuthService.GetUserAuthToken(userLogin.UserName, user.Id, user.Roles);

            return(userToken);
        }
 public async Task PasswordSignInAsync(UserLoginWriteModel userLogin)
 {
     await _userAuthDomainService.PasswordSignInAsync(userLogin);
 }
示例#3
0
 public async Task PasswordSignInAsync(UserLoginWriteModel userLogin)
 {
     await _signInManager.PasswordSignInAsync(userLogin.UserName, userLogin.Password, userLogin.RememberMe, false);
 }