Nuxt auth-module google login promise on success

Viewed 2143

I am using Nuxt with the auth-module.

Logging in to Google works:

this.$auth.loginWith("google").then(() => {
    console.log("Logged in!");
});

Here is my google login strategy:

google: {
    scope: [
        "openid",
        "profile",
        "email",
        "https://www.googleapis.com/auth/gmail.metadata"
    ],
    client_id: "CLIENT_ID",
    response_type: "code",
    access_token_endpoint: "http://localhost:4000/auth/google/"
}

The problem that I am facing is that the promise is resolved as soon as the login button is clicked. So that "Logged in!" is written to the console. This is not expected behavior. The promise should be resolved when the user returns from a successful OAuth2 flow.

Does someone know what's wrong?

0 Answers
Related