def sign_in
      @client_security_token = @x_security_token = nil

      body = { identifier: username, password: password_encryptor.encrypt(password), encryptedPassword: true }

      sign_in_result = request method: :post, url: 'session', body: body, api_version: API_V2

      headers = sign_in_result.fetch(:response).headers
      @client_security_token = headers.fetch 'CST'
      @x_security_token = headers.fetch 'X-SECURITY-TOKEN'

      sign_in_result.fetch :body
    end
def sign_in
      @client_security_token = @x_security_token = nil

      body = { identifier: username, password: password_encryptor.encrypt(password), encryptedPassword: true }

      sign_in_result = request method: :post, url: 'session', body: body, api_version: API_V2

      headers = sign_in_result.fetch(:response).headers
      @client_security_token = headers.fetch 'CST'
      @x_security_token = headers.fetch 'X-SECURITY-TOKEN'

      sign_in_result.fetch :body
    end
Signs in to IG Markets using the values of {#username}, {#password}, {#api_key} and {#platform}. If an error
 occurs then an {IGMarketsError} will be raised.

 @return [Hash] The data returned in the body of the sign in request.