private async Task <Tokens> CreateTokens(string username) { UserDto user = await managementService.GetUserData(username); var claims = user.CreateClaims(); var token = tokenUtil.CreateToken(claims); var tokenString = new JwtSecurityTokenHandler().WriteToken(token); string refreshToken = tokenUtil.GenerateRefreshToken(); return(new Tokens { Token = tokenString, RefreshToken = refreshToken }); }