Feature request: add account to use when --open
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.
Unfortunately not possible to provide the account hint that way.
Ignore previous comment :)
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.
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.