Google Single account login does not show a way to use any other account

Custom Login Form

Login with Google did let the user select another account. Let’s say a user logs in with Google and selects Account A. After that, they log out and want to log in again with Account B. However, when the user clicks on “Login with Google,” it automatically logs them in with Account A without showing other account options.


<script src="https://cdn.auth0.com/js/auth0/9.26/auth0.min.js"></script>
<script src="https://cdn.auth0.com/js/polyfills/1.0/object-assign.min.js"></script>
<script>
    window.addEventListener('load', function () {

        var config = JSON.parse(
            decodeURIComponent(escape(window.atob('@@config@@')))
        );

        var leeway = config.internalOptions.leeway;
        if (leeway) {
            var convertedLeeway = parseInt(leeway);

            if (!isNaN(convertedLeeway)) {
                config.internalOptions.leeway = convertedLeeway;
            }
        }

        var params = Object.assign({
            overrides: {
                __tenant: config.auth0Tenant,
                __token_issuer: config.authorizationServer.issuer
            },
            domain: config.auth0Domain,
            clientID: config.clientID,
            redirectUri: config.callbackURL,
            responseType: 'code'
        }, config.internalOptions);

        var triggerCaptcha = null;
        var webAuth = new auth0.WebAuth(params);

        function loginWithGoogle() {
            webAuth.authorize({
                connection: 'google-oauth2',
                prompt: 'select_account'
            }, function (err) {
                if (err) displayError(err);
            });
        }


        document.getElementById('btn-google').addEventListener('click', loginWithGoogle);
    });
</script>

i have pass promt : 'select_account' but it did’t show list of accounts

Hey @muhammad.awais.77831 :wave:

I’ve seen other posts in the past suggest that passing prompt: 'login' to force the user to select a different Google account may work instead. Give that a try and see if it resolves your issue!

Yes i tried that as you can see here

function loginWithGoogle() {
            webAuth.authorize({
                connection: 'google-oauth2',
                prompt: 'select_account'
            }, function (err) {
                if (err) displayError(err);
            });
        }

You have prompt: 'select_account' in the code, does it work if you switch it to prompt: 'login' instead?

or my case, if I open the web in Brave or any browser other than Chrome, it works fine and shows a list of accounts. However, in Chrome, each profile has an account, so there is only one account shown. Therefore, it simply logs in with that account instead of showing the list.

I appreciate you forwarding this information. It’s highly relevant to my work and will be very beneficial.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.