sandbox 3.4.2 → 3.4.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.
|
@@ -6973,13 +6973,8 @@ var import_cjs$26 = /* @__PURE__ */ __toESM(require_cjs());
|
|
|
6973
6973
|
init_source();
|
|
6974
6974
|
var import_dist = require_dist();
|
|
6975
6975
|
const debug$7 = createDebugger("sandbox:args:auth");
|
|
6976
|
-
/**
|
|
6977
|
-
* Timestamp (ms epoch) of the most recent auto-login. Used to identify
|
|
6978
|
-
* tokens so that the first 401/403 against a freshly-issued token can be
|
|
6979
|
-
* retried instead of surfaced to the user.
|
|
6980
|
-
*/
|
|
6981
6976
|
let freshTokenAcquiredAt;
|
|
6982
|
-
const FRESH_TOKEN_WINDOW_MS =
|
|
6977
|
+
const FRESH_TOKEN_WINDOW_MS = 15e3;
|
|
6983
6978
|
function isTokenFresh() {
|
|
6984
6979
|
return freshTokenAcquiredAt !== void 0 && Date.now() - freshTokenAcquiredAt < FRESH_TOKEN_WINDOW_MS;
|
|
6985
6980
|
}
|
|
@@ -7002,7 +6997,10 @@ const token = import_cjs$26.option({
|
|
|
7002
6997
|
console.warn(source_default.yellow(`${source_default.bold("warn:")} failed to get or refresh OIDC token, using personal token authentication.`));
|
|
7003
6998
|
}
|
|
7004
6999
|
try {
|
|
7005
|
-
|
|
7000
|
+
const previousToken = getAuth()?.token;
|
|
7001
|
+
const storedToken = await (0, import_dist.getVercelToken)();
|
|
7002
|
+
if (previousToken && storedToken !== previousToken) markTokenAsFresh();
|
|
7003
|
+
return storedToken;
|
|
7006
7004
|
} catch (error) {
|
|
7007
7005
|
if (error instanceof import_dist.AccessTokenMissingError || error instanceof import_dist.RefreshAccessTokenFailedError) {
|
|
7008
7006
|
debug$7(`CLI token unavailable (${error.name}), prompting for login...`);
|
|
@@ -7286,7 +7284,7 @@ const scope = {
|
|
|
7286
7284
|
|
|
7287
7285
|
//#endregion
|
|
7288
7286
|
//#region package.json
|
|
7289
|
-
var version = "3.4.
|
|
7287
|
+
var version = "3.4.3";
|
|
7290
7288
|
|
|
7291
7289
|
//#endregion
|
|
7292
7290
|
//#region src/error.ts
|
|
@@ -12087,4 +12085,4 @@ const app = (opts) => (0, import_cjs.subcommands)({
|
|
|
12087
12085
|
|
|
12088
12086
|
//#endregion
|
|
12089
12087
|
export { source_exports as a, init_source as i, printTopLevelError as n, require_cjs as r, app as t };
|
|
12090
|
-
//# sourceMappingURL=app-
|
|
12088
|
+
//# sourceMappingURL=app-BHH8y5dv.mjs.map
|