Skip to content

Print auth URL in case the code fails to open default browser #205

Open
@nmlynch94

Description

@nmlynch94

What would you like to see in the library?

When calling authenticate, it attempts to open a browser to authorize the google application to access your data. However, in my case for some reason it was failing to open my browser on Fedora 41. There were no errors in the logs and it just hangs, presumably waiting for the user to interact with the browser.

I would like to print the auth URL as a fallback that can be copied into the browser. In my case, I modified index.js to be:

            // open the browser to the authorize url to start the workflow
            const authorizeUrl = client.generateAuthUrl({
                redirect_uri: redirectUri.toString(),
                access_type: 'offline',
                scope: scopes.join(' '),
            });
            console.log("URL: " + authorizeUrl)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions