async Task <IActionResult> CheckUserCanJoinSessionAsync(SessionModel session, string nickname, string userId, string rejoinCode, CancellationToken cancellationToken)
        {
            if (await _sessionProvider.DoesUserExistInSessionAsync(session.SessionId, nickname, cancellationToken))
            {
                if (userId != null && !ValidationHelper.ValidateObjectId(userId))
                {
                    return(BadRequest());
                }

                var user = string.IsNullOrEmpty(userId) ? null : await _sessionProvider.GetUserByIdAsync(userId, cancellationToken);

                if (user is null || user.RejoinCode != rejoinCode)
                {
                    return(Conflict());
                }
            }

            return(Ok());
        }