Exemple #1
0
        public IActionResult Login(LoginCompanyViewModel loginCompanyViewModel)
        {
            var result = _companyBLL.VerifyIfCompanyExist(loginCompanyViewModel);

            if (result != Guid.Empty)
            {
                return(Ok(result));
            }

            return(NotFound("Invalid credencials"));
        }
        public Guid VerifyIfCompanyExist(LoginCompanyViewModel lvm)
        {
            var token = _context.Company.Where(c => c.Email == lvm.email && c.Password == lvm.password && c.FiscalId == lvm.fiscalId).FirstOrDefault();

            return(token == null ? Guid.Empty : token.Token);
        }