@embeddable.com/sdk-core 3.12.0-next.2 → 3.12.0-next.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/lib/index.esm.js +13 -2
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +13 -2
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/src/login.ts +14 -1
package/lib/index.esm.js
CHANGED
|
@@ -21398,11 +21398,19 @@ var login = async () => {
|
|
|
21398
21398
|
client_id: config.authClientId,
|
|
21399
21399
|
};
|
|
21400
21400
|
await open(deviceCodeResponse.data["verification_uri_complete"]);
|
|
21401
|
+
let isTerminated = false;
|
|
21402
|
+
const signalHandler = () => {
|
|
21403
|
+
isTerminated = true;
|
|
21404
|
+
authenticationSpinner.fail("Authentication process interrupted");
|
|
21405
|
+
process.exit(0);
|
|
21406
|
+
};
|
|
21407
|
+
process.on("SIGTERM", signalHandler);
|
|
21408
|
+
process.on("SIGINT", signalHandler);
|
|
21401
21409
|
/**
|
|
21402
21410
|
* This is a recommended way to poll, since it take some time for a user to enter a `user_code` in a browser.
|
|
21403
21411
|
* deviceCodeResponse.data['interval'] is a recommended/calculated polling interval specified in seconds.
|
|
21404
21412
|
*/
|
|
21405
|
-
while (
|
|
21413
|
+
while (!isTerminated) {
|
|
21406
21414
|
try {
|
|
21407
21415
|
const tokenResponse = await axios.post(`https://${config.authDomain}/oauth/token`, tokenPayload);
|
|
21408
21416
|
await fs.writeFile(CREDENTIALS_FILE, JSON.stringify(tokenResponse.data));
|
|
@@ -21417,6 +21425,9 @@ var login = async () => {
|
|
|
21417
21425
|
await sleep(deviceCodeResponse.data["interval"] * 1000);
|
|
21418
21426
|
}
|
|
21419
21427
|
}
|
|
21428
|
+
// Clean up signal handlers
|
|
21429
|
+
process.off("SIGTERM", signalHandler);
|
|
21430
|
+
process.off("SIGINT", signalHandler);
|
|
21420
21431
|
}
|
|
21421
21432
|
catch (error) {
|
|
21422
21433
|
authenticationSpinner.fail("Authentication failed. Please try again.");
|
|
@@ -21995,7 +22006,7 @@ var defineConfig = ({ plugins, pushBaseUrl, audienceUrl, authDomain, authClientI
|
|
|
21995
22006
|
};
|
|
21996
22007
|
|
|
21997
22008
|
var name = "@embeddable.com/sdk-core";
|
|
21998
|
-
var version = "3.12.0-next.
|
|
22009
|
+
var version = "3.12.0-next.3";
|
|
21999
22010
|
var description = "Core Embeddable SDK module responsible for web-components bundling and publishing.";
|
|
22000
22011
|
var keywords = [
|
|
22001
22012
|
"embeddable",
|