public async Task <ActionResult <bool> > IsAdminUser([FromBody] AuthedRequest token)
        {
            try
            {
                var requestUid = await token.Verify();

                if (requestUid == null)
                {
                    return(Unauthorized());
                }

                return(Ok((await _adminRepository.IsAdminUser(requestUid))));
            }
            catch (Exception e)
            {
                _logger.LogError(e, "Exception getting categories");
                throw;
            }
        }
Пример #2
0
        public async Task <ActionResult <Basket> > GetCurrentBasket([FromBody] AuthedRequest token)
        {
            try
            {
                var requestUid = await token.Verify();

                if (requestUid == null)
                {
                    return(Unauthorized());
                }

                return(Ok((await _sessionRepository.GetCurrentBasket(requestUid))));
            }
            catch (Exception e)
            {
                _logger.LogError(e, "Exception getting categories");
                throw;
            }
        }