Problem with Integration Callback URL (OAuth)

Hi there,

I am currently trying to develop a plugin to authenticate via OAuth from another service.
The docs and examples are quite unclear as they do not follow the same standards, and I am having problems with calling the callback route of Mautic.

As stated in the documentation, I used:

public function getRedirectUri(): string
  {
    return $this->router->generate(
      'mautic_integration_public_callback',
      ['integration' => $this->getName()],
      UrlGeneratorInterface::ABSOLUTE_URL
    );
  }

To generate the callback URL. This works as intended. But on arriving there it should call the AuthController.php from the IntegrationsBundle and render the authenticated.html.twig.

All I am getting is the correct call to the URL (with a code appended per OAuth) and this error:
500 Internal Server Error - Variable “indexButton” does not exist.

I tracked it back to the pageheader.html.twig file where the indexButton is getting used (app/bundles/CoreBundle/Resources/views/Default/pageheader.html.twig) but I am not able to circumvent this error.

Does someone have an idea why this happens?
Otherwise, I have to write my own route and controller for this. But I wanted to use the official tools to implement integration authentication.