Git Product home page Git Product logo

Comments (5)

mhawksey avatar mhawksey commented on May 6, 2024 1

The command/flag for the Firebase CLI is login --no-localhost As this is also Google Auth flow you might be able to reuse some of the code from their implementation https://github.com/firebase/firebase-tools

from clasp.

grant avatar grant commented on May 6, 2024 1

Will close this issue in the next release.

from clasp.

rielzzapps avatar rielzzapps commented on May 6, 2024

from clasp.

grant avatar grant commented on May 6, 2024

This is a good idea. Let's think about what the design should be:

$ clasp login --no-localhost
> Open: http://console.google.com/...
> Paste the token: ...
> Saved the credentials to ~/.clasp.rc.json.

gcloud's browserless solution: gcloud auth login --no-launch-browser

Is there a common name for browserless login flag (-f and/or --flag) we should use?

Temporary workaround:

Copy ~/.clasprc.json to your machine.

from clasp.

grant avatar grant commented on May 6, 2024

The initial login command didn't use localhost. When we tackle this feature, we can just use the previous login via command line with the code here:

clasp/index.js

Lines 336 to 355 in 7588283

const requestAuthorization = (refreshToken, cb) => {
var authUrl = oauth2Client.generateAuthUrl({
access_type: 'offline',
scope: ['https://www.googleapis.com/auth/script.management'],
});
console.log(LOG.AUTHORIZE(authUrl));
openurl.open(authUrl);
var rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
rl.question(LOG.AUTH_CODE, (code) => {
rl.close();
oauth2Client.getToken(code, (err, token) => {
if (err) return console.error(ERROR.ACCESS_TOKEN + err);
console.log(LOG.AUTH_SUCCESSFUL);
cb(token);
});
});
}

from clasp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.