Esempio n. 1
0
        public async Task <ActionResult <Client> > GetClient(Guid id)
        {
            try
            {
                if (!(await _auth.Authorized(_repository, Request.Headers["Authorization"].ToString(), id.ToString())))
                {
                    return(Forbid());
                }

                Client client = await _repository.GetClientByIDAsync(id);

                return(Ok(client));
            }
            catch (Exception e)
            {
                return(StatusCode(StatusCodes.Status500InternalServerError, e.Message));
            }
        }