GoodMoodProvider/APIGoodMoodProvider/APIGoodMoodProvider/Controllers/UserController.cs
/// <summary>
/// Cheks if refresh token is expired and refreshes tokens if not
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
Cheks if refresh token is expired and refreshes tokens if not
Cheks if refresh token is expired and refreshes tokens if not
[AllowAnonymous]
        [HttpGet]
        [Route("refresh/{id}")]
        public async Task<IActionResult> RefreshToken(Guid id)
        {
            var user = await _unitOfWork.UserRepository.GetByIdAsync(id);
            _userHandler.RefreshToken(user.RefreshToken, id);
            await _unitOfWork.SaveDBAsync();
            return Ok(user.Token);
        }
[ AllowAnonymous ] [ HttpGet ] [ Route ( " " ) ] public async Task < IActionResult > RefreshToken ( Guid id ) { var user = await _unitOfWork . UserRepository . GetByIdAsync ( id ) ; _userHandler . RefreshToken ( user . RefreshToken , id ) ; await _unitOfWork . SaveDBAsync ( ) ; return Ok ( user . Token ) ; }
Cheks if refresh token is expired and refreshes tokens if not
Cheks if refresh token is expired and refreshes tokens if not
None
id
Guid
None