Exemple #1
0
        public async Task <IActionResult> Logout([FromForm] string refreshToken)
        {
            var refreshTokenDb = await _tokenRepo.FindByValueAsync(refreshToken);

            if (refreshTokenDb is null)
            {
                return(NotFound("Refresh Token not found."));
            }

            _tokenRepo.RevokeToken(refreshTokenDb);
            await _uow.CompleteAsync();

            return(Ok());
        }