public function loginAction(Client $oauthClient, Session $session): RedirectResponse
    {
        // Automatically log in a development user if defined.
        $loggedInUser = $this->getParameter('toolforge.oauth.logged_in_user');
        if ($loggedInUser) {
            $this->get('session')->set('logged_in_user', (object)[
                'username' => $loggedInUser,
            ]);
            return $this->redirectToRoute('home');
        }

        // Otherwise, continue with OAuth authentication.
        [$next, $token] = $oauthClient->initiate();

        // Save the request token to the session.
        $session->set('oauth.request_token', $token);

        // Send the user to Meta Wiki.
        return new RedirectResponse($next);
    }