Ejemplo n.º 1
0
        public IHttpActionResult LogInToApp()
        {
            var authorization = _authService.Authorize(Request);

            if (!authorization)
            {
                var result = Unauthorized();
                return(result);
            }
            else
            {
                var users              = _context.Users.ToList();
                var logIn              = _headerFilter.GetHeader(Request.Headers, LogInHeader);
                var password           = _headerFilter.GetHeader(Request.Headers, PasswordHeader);
                var autorisationResult = _service.AutoriseUser(users, logIn, password);
                return(Ok(autorisationResult));
            }
        }