@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.js
CHANGED
|
@@ -21426,11 +21426,19 @@ var login = async () => {
|
|
|
21426
21426
|
client_id: config.authClientId,
|
|
21427
21427
|
};
|
|
21428
21428
|
await open(deviceCodeResponse.data["verification_uri_complete"]);
|
|
21429
|
+
let isTerminated = false;
|
|
21430
|
+
const signalHandler = () => {
|
|
21431
|
+
isTerminated = true;
|
|
21432
|
+
authenticationSpinner.fail("Authentication process interrupted");
|
|
21433
|
+
process.exit(0);
|
|
21434
|
+
};
|
|
21435
|
+
process.on("SIGTERM", signalHandler);
|
|
21436
|
+
process.on("SIGINT", signalHandler);
|
|
21429
21437
|
/**
|
|
21430
21438
|
* This is a recommended way to poll, since it take some time for a user to enter a `user_code` in a browser.
|
|
21431
21439
|
* deviceCodeResponse.data['interval'] is a recommended/calculated polling interval specified in seconds.
|
|
21432
21440
|
*/
|
|
21433
|
-
while (
|
|
21441
|
+
while (!isTerminated) {
|
|
21434
21442
|
try {
|
|
21435
21443
|
const tokenResponse = await axios.post(`https://${config.authDomain}/oauth/token`, tokenPayload);
|
|
21436
21444
|
await fs__namespace.writeFile(CREDENTIALS_FILE, JSON.stringify(tokenResponse.data));
|
|
@@ -21445,6 +21453,9 @@ var login = async () => {
|
|
|
21445
21453
|
await sleep(deviceCodeResponse.data["interval"] * 1000);
|
|
21446
21454
|
}
|
|
21447
21455
|
}
|
|
21456
|
+
// Clean up signal handlers
|
|
21457
|
+
process.off("SIGTERM", signalHandler);
|
|
21458
|
+
process.off("SIGINT", signalHandler);
|
|
21448
21459
|
}
|
|
21449
21460
|
catch (error) {
|
|
21450
21461
|
authenticationSpinner.fail("Authentication failed. Please try again.");
|
|
@@ -22023,7 +22034,7 @@ var defineConfig = ({ plugins, pushBaseUrl, audienceUrl, authDomain, authClientI
|
|
|
22023
22034
|
};
|
|
22024
22035
|
|
|
22025
22036
|
var name = "@embeddable.com/sdk-core";
|
|
22026
|
-
var version = "3.12.0-next.
|
|
22037
|
+
var version = "3.12.0-next.3";
|
|
22027
22038
|
var description = "Core Embeddable SDK module responsible for web-components bundling and publishing.";
|
|
22028
22039
|
var keywords = [
|
|
22029
22040
|
"embeddable",
|