clasp icon indicating copy to clipboard operation
clasp copied to clipboard

Feature request: add account to use when --open

Open krank opened this issue 6 years ago • 4 comments

Those of us who regularly use multiple google accounts would, I think, greatly appreciate the ability to specify which account to be used for --open.

Example: I'm logged in (on the web side of things, in the browser) as both [email protected] and, using Google's multi-account functionality, [email protected] (which is still a google account, just connected to a corporate domain). The [email protected] account is my default.

Now, it doesn't matter if the project I'm working on is owned by [email protected] or by [email protected] – if I do a clasp --open then the browser will try to open the project as [email protected].

I'd like the ability to do, for instance:

clasp --open --account [email protected]

Or something like that, anyways. Sorry if unclear.

krank avatar Oct 18 '19 17:10 krank

Unfortunately not possible to provide the account hint that way.

sqrrrl avatar Mar 11 '25 21:03 sqrrrl

Ignore previous comment :)

sqrrrl avatar Mar 13 '25 23:03 sqrrrl

Code has been heavily changed since the PR, but looking at reintegrating it. Unfortunatley authUser param can be a little flakey. Seems to be OK for the apps script IDE, less so for the cloud developer console.

sqrrrl avatar Mar 13 '25 23:03 sqrrrl

Did some more testing, just not reliable enough and there are some cases where specifying authUser leads to redirect loops & 404 errors. Apps Script has always had some multi-login issues and while slightly better now, it's not quite right yet.

In any case, added it behind a flag in 3.x (avail in next release) and disabled by default. When that's published you can try by setting the env variable CLASP_ENABLE_USER_HINTS=1.

sqrrrl avatar Mar 14 '25 01:03 sqrrrl