public async Task <IActionResult> Login(LoginDto loginData)
        {
            var user = await _authManager.FindByUserName(loginData.UserName);

            if (!await _authManager.AuthorizeUser(user, loginData.Password))
            {
                return(Unauthorized());
            }

            var token = await _authManager.GenerateJwtToken(user);

            return(Ok(new { token }));
        }