Beispiel #1
0
        public IActionResult Get([FromBody] AuthorizeRequest request)
        {
            if (request.Token == null)
            {
                return(BadRequest("No authentication token given"));
            }

            var role = tokenMapper.GetUser(request.Token).Role;

            if (role != 2)
            {
                return(Unauthorized());
            }

            return(Ok(new { passwords = context.Passwords.ToList() }));
        }
        public IEnumerable <Connection> Get([FromBody] AuthorizeRequest request)
        {
            var user = mapper.GetUser(request.Token);

            return(keyManager.GetPendingConnections(user.Username));
        }