@v-aranda/artifice 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/auth/google-auth.js +9 -2
package/package.json
CHANGED
package/src/auth/google-auth.js
CHANGED
|
@@ -7,9 +7,16 @@ import { getLocalConfig, saveLocalConfig } from '../utils/config.js';
|
|
|
7
7
|
|
|
8
8
|
export const GOOGLE_SCOPE = 'https://www.googleapis.com/auth/cloud-platform';
|
|
9
9
|
|
|
10
|
+
export function getBrowserLaunchCommand(url, platform = process.platform) {
|
|
11
|
+
// Do not invoke cmd.exe here: it treats '&' in OAuth query strings as command
|
|
12
|
+
// separators and silently drops parameters such as response_type=code.
|
|
13
|
+
const command = platform === 'win32' ? 'rundll32.exe' : platform === 'darwin' ? 'open' : 'xdg-open';
|
|
14
|
+
const args = platform === 'win32' ? ['url.dll,FileProtocolHandler', url] : [url];
|
|
15
|
+
return { command, args };
|
|
16
|
+
}
|
|
17
|
+
|
|
10
18
|
function openBrowser(url) {
|
|
11
|
-
const command
|
|
12
|
-
const args = process.platform === 'win32' ? ['/c', 'start', '', url] : [url];
|
|
19
|
+
const { command, args } = getBrowserLaunchCommand(url);
|
|
13
20
|
execFile(command, args, () => {});
|
|
14
21
|
}
|
|
15
22
|
|