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); }