Exemple #1
0
 public UnitOfWork(ApiDataContext dc, IDomainUnitOfWork duow, LoginResDTO loginResDTO, IMapper mapper)
 {
     this.duow        = duow;
     this.loginResDTO = loginResDTO;
     this.mapper      = mapper;
     this.dc          = dc;
 }
        public async Task <IActionResult> Login(LoginReqDTO loginReqDTO)
        {
            var user = await uow.userRepository.Authenticate(loginReqDTO.UserName, loginReqDTO.Password);

            if (user == null)
            {
                return(Unauthorized());
            }
            var LoginRes = new LoginResDTO();

            LoginRes.UserName = user.UserName;
            LoginRes.Token    = CreateJWT(user);
            return(Ok(LoginRes));
        }
 public LoginApplication(LoginResDTO loginResDTO, IDomainUnitOfWork duow)
 {
     this.duow        = duow;
     this.loginResDTO = loginResDTO;
 }
Exemple #4
0
 public RegisterController(IUnitOfWork uow, LoginResDTO loginResDTO)
 {
     this.uow         = uow;
     this.loginResDTO = loginResDTO;
 }