Google Login returning only code and state query parameters

Hi,

I’m using auth.js (v9.9.0) and logging in fine with username\password. However, when I try to log in with a social provider (Google), the callback doesn’t have the usual #access_token=..... in the url, but instead has ?code=...&state=... and the parseHash function is returning both nulls for the error and authResult.

I’m using the example from Auth0 for the handleAuthentication() function:

        return new Promise((resolve, reject) => {
            this.auth0.parseHash((err, authResult) => {
                if (err) {
                    console.log("Err:" + err);
                    return reject(err);
                }
                if (!authResult || !authResult.idToken) {
                    console.log("authResult:" + authResult);
                    console.log("Err:" + err);
                    return reject(err);
                }
                console.log('Logged in');
                this.setSession(authResult);
                resolve();
            });
        })

I’m using Auth0’s keys for the Google login and I believe I’ve set it all up correctly, but clearly missing something.

Hope someone can help me out!

Cheers,
Russ

1 Like

Hey there!

Terribly sorry for such delay in response! We’re doing our best in providing the best developer support experience out there, but sometimes our bandwidth is just not enough for all the questions that are coming in. Sorry for the inconvenience!

Do you still require further assistance from us?