viviscape-mcp 2.0.0 → 2.0.1
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/dist/auth/auth-service.js +12 -2
- package/package.json +1 -1
|
@@ -134,11 +134,21 @@ function respond(res, status, contentType, body) {
|
|
|
134
134
|
res.end(buf);
|
|
135
135
|
}
|
|
136
136
|
function openBrowser(url, log) {
|
|
137
|
-
|
|
137
|
+
// Windows: `cmd /c start` treats an unquoted `&` as a command separator, and
|
|
138
|
+
// Node only quotes args containing spaces or quotes -- so the login URL was cut
|
|
139
|
+
// at the first `&` and the page loaded with no `state` (the server answers 400
|
|
140
|
+
// "invalid state"). Quote the URL ourselves and pass the line to cmd verbatim.
|
|
141
|
+
const win = process.platform === 'win32';
|
|
142
|
+
const [cmd, args] = win ? ['cmd.exe', ['/c', 'start', '""', `"${url}"`]] :
|
|
138
143
|
process.platform === 'darwin' ? ['open', [url]] :
|
|
139
144
|
['xdg-open', [url]];
|
|
140
145
|
try {
|
|
141
|
-
const child = spawn(cmd, args, {
|
|
146
|
+
const child = spawn(cmd, args, {
|
|
147
|
+
detached: true,
|
|
148
|
+
stdio: 'ignore',
|
|
149
|
+
windowsHide: true,
|
|
150
|
+
windowsVerbatimArguments: win,
|
|
151
|
+
});
|
|
142
152
|
child.on('error', () => log('Could not open the browser automatically. Open the URL above manually.'));
|
|
143
153
|
child.unref();
|
|
144
154
|
}
|
package/package.json
CHANGED