@freesyntax/notch-cli 0.4.2 → 0.4.5
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.
|
@@ -83,9 +83,11 @@ async function login() {
|
|
|
83
83
|
const port = await findFreePort();
|
|
84
84
|
return new Promise((resolve, reject) => {
|
|
85
85
|
let settled = false;
|
|
86
|
+
let timeoutId;
|
|
86
87
|
const finish = (fn) => {
|
|
87
88
|
if (!settled) {
|
|
88
89
|
settled = true;
|
|
90
|
+
clearTimeout(timeoutId);
|
|
89
91
|
server.close(fn);
|
|
90
92
|
}
|
|
91
93
|
};
|
|
@@ -123,7 +125,7 @@ async function login() {
|
|
|
123
125
|
|
|
124
126
|
`);
|
|
125
127
|
});
|
|
126
|
-
setTimeout(() => {
|
|
128
|
+
timeoutId = setTimeout(() => {
|
|
127
129
|
finish(() => reject(new Error("Authentication timed out after 5 minutes.")));
|
|
128
130
|
}, AUTH_TIMEOUT_MS);
|
|
129
131
|
});
|