Example #1
0
        public async Task <IActionResult> DeleteAsync([FromRoute] long userId)
        {
            if (!User.HasClaim(AuthConsts.Claims.Types.UserId, userId.ToString()))
            {
                logger.LogInformation($"You have no access to {userId}");
                return(StatusCode(403, $"You have no access to {userId}"));
            }

            await userStorage.DeleteAsync(userId).ConfigureAwait(false);

            return(NoContent());
        }