Skip to content
This repository was archived by the owner on Apr 18, 2026. It is now read-only.
This repository was archived by the owner on Apr 18, 2026. It is now read-only.

Cann't get refresh_token with GoogleAuth.signIn #538

Description

@nmquaan-bigbom

Hi there,
Please help resolve my problem, I want to get refresh_token when user login with google use javascript.
This is my code.

<script>
        window.gapi;
        window.ggInit = options => {
            gapi.load('auth2', function () {
                window.gapi = gapi;
                gapi.auth2.init(options).then(() => {
                    window.GoogleAuth = gapi.auth2.getAuthInstance();
                });
            });
        };
</script>
if (window.GoogleAuth) {
            window.GoogleAuth.signIn({
                scope: 'profile email https://www.googleapis.com/auth/adwords',
                access_type: 'offline',
                prompt: 'consent',
            })
                .then(googleUser => {
                    this.loginGoogleCallback(googleUser);
                })
                .catch(err => {
                    console.log('Err', err);
                });
}
This is response data
access_token: ""
expires_at: 1561026652957
expires_in: 3600
first_issued_at: 1561023052957
id_token: ""
idpId: "google"
login_hint: ""
scope: "email profile https://www.googleapis.com/auth/userinfo.profile openid https://www.googleapis.com/auth/adwords https://www.googleapis.com/auth/userinfo.email"
session_state: {extraQueryParams: {}}
token_type: "Bearer"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions