Example #1
0
        public override async Task <InvalidateSessionReply> InvalidateSession(InvalidateSessionRequest request, ServerCallContext context)
        {
            AppUser user = await _userManager.GetUserAsync(context.GetHttpContext().User);

            Guid sessionId = new Guid(request.Id);

            _sessionManager.ExpireSession(user, sessionId);

            return(new InvalidateSessionReply {
                Success = true
            });
        }
Example #2
0
        [HttpPost] //Frombody-> deserializa los argumentos pasados a la api
        public IActionResult InvalidateSession([FromBody] InvalidateSessionRequest request)
        {
            bool result = _cacheManager.Del <string>($"{request.username}_{request.audience}");

            return(result ? StatusCode(200) : StatusCode(204));
        }