Example #1
0
        public IActionResult GetStatus([FromServices] MiniAuth auth, [FromServices] AppHealth appStatus)
        {
            if (auth.Validate(Request).Status != ResponseStatus.Succeeded)
            {
                return(Unauthorized());
            }

            return(new JsonHttpResponse(appStatus));
        }
        public IActionResult GetStatus()
        {
            if (!_auth.Validate(Request))
            {
                return(Unauthorized());
            }

            return(new HttpResponse(App.Common.Response.Success));
        }
Example #3
0
        private IActionResult GetResponse(AppRequests requests, string requestName)
        {
            var authResult = _auth.Validate(Request);

            if (authResult.Status != ResponseStatus.Succeeded)
            {
                return(Unauthorized());
            }

            var req = new RequestParams(new AppActor(authResult.Content.Sub, _users.Get(authResult.Content.Sub).Roles),
                                        requestName, GetRawBodyString());

            var response = requests.Execute(req);

            return(new JsonHttpResponse(response));
        }