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 }); }
[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)); }