@stackframe/js 2.8.52 → 2.8.56
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/CHANGELOG.md +40 -0
- package/dist/esm/lib/cookie.js +50 -15
- package/dist/esm/lib/cookie.js.map +1 -1
- package/dist/esm/lib/stack-app/apps/implementations/admin-app-impl.js +7 -1
- package/dist/esm/lib/stack-app/apps/implementations/admin-app-impl.js.map +1 -1
- package/dist/esm/lib/stack-app/apps/implementations/client-app-impl.js +7 -6
- package/dist/esm/lib/stack-app/apps/implementations/client-app-impl.js.map +1 -1
- package/dist/esm/lib/stack-app/apps/implementations/common.js +1 -1
- package/dist/esm/lib/stack-app/apps/implementations/common.js.map +1 -1
- package/dist/esm/lib/stack-app/apps/implementations/server-app-impl.js +2 -4
- package/dist/esm/lib/stack-app/apps/implementations/server-app-impl.js.map +1 -1
- package/dist/esm/lib/stack-app/apps/interfaces/admin-app.js.map +1 -1
- package/dist/esm/lib/stack-app/projects/index.js +3 -1
- package/dist/esm/lib/stack-app/projects/index.js.map +1 -1
- package/dist/index.d.mts +19 -18
- package/dist/index.d.ts +19 -18
- package/dist/integrations/convex.d.mts +11 -0
- package/dist/integrations/convex.d.ts +11 -0
- package/dist/lib/cookie.js +50 -15
- package/dist/lib/cookie.js.map +1 -1
- package/dist/lib/stack-app/apps/implementations/admin-app-impl.js +7 -1
- package/dist/lib/stack-app/apps/implementations/admin-app-impl.js.map +1 -1
- package/dist/lib/stack-app/apps/implementations/client-app-impl.js +6 -5
- package/dist/lib/stack-app/apps/implementations/client-app-impl.js.map +1 -1
- package/dist/lib/stack-app/apps/implementations/common.js +1 -1
- package/dist/lib/stack-app/apps/implementations/common.js.map +1 -1
- package/dist/lib/stack-app/apps/implementations/server-app-impl.js +4 -16
- package/dist/lib/stack-app/apps/implementations/server-app-impl.js.map +1 -1
- package/dist/lib/stack-app/apps/interfaces/admin-app.js.map +1 -1
- package/dist/lib/stack-app/projects/index.js +3 -1
- package/dist/lib/stack-app/projects/index.js.map +1 -1
- package/package.json +11 -2
|
@@ -39,6 +39,7 @@ var import_sessions = require("@stackframe/stack-shared/dist/sessions");
|
|
|
39
39
|
var import_bytes = require("@stackframe/stack-shared/dist/utils/bytes");
|
|
40
40
|
var import_env = require("@stackframe/stack-shared/dist/utils/env");
|
|
41
41
|
var import_errors = require("@stackframe/stack-shared/dist/utils/errors");
|
|
42
|
+
var import_json = require("@stackframe/stack-shared/dist/utils/json");
|
|
42
43
|
var import_maps = require("@stackframe/stack-shared/dist/utils/maps");
|
|
43
44
|
var import_objects = require("@stackframe/stack-shared/dist/utils/objects");
|
|
44
45
|
var import_promises = require("@stackframe/stack-shared/dist/utils/promises");
|
|
@@ -58,7 +59,6 @@ var import_projects = require("../../projects/index.js");
|
|
|
58
59
|
var import_teams = require("../../teams/index.js");
|
|
59
60
|
var import_users = require("../../users/index.js");
|
|
60
61
|
var import_common2 = require("./common.js");
|
|
61
|
-
var import_json = require("@stackframe/stack-shared/dist/utils/json");
|
|
62
62
|
var isReactServer = false;
|
|
63
63
|
var process = globalThis.process ?? { env: {} };
|
|
64
64
|
var allClientApps = /* @__PURE__ */ new Map();
|
|
@@ -483,9 +483,10 @@ var __StackClientAppImplIncomplete = class __StackClientAppImplIncomplete {
|
|
|
483
483
|
return;
|
|
484
484
|
}
|
|
485
485
|
const domain = await this._trustedParentDomainCache.getOrWait([hostname], "read-write");
|
|
486
|
+
const cookieOptions = { maxAge: 60 * 60 * 24 * 365, noOpIfServerComponent: true };
|
|
486
487
|
const setCookie = async (targetDomain, value2) => {
|
|
487
488
|
const name = this._getCustomRefreshCookieName(targetDomain);
|
|
488
|
-
const options = {
|
|
489
|
+
const options = { ...cookieOptions, domain: targetDomain };
|
|
489
490
|
if (context === "browser") {
|
|
490
491
|
(0, import_cookie.setOrDeleteCookieClient)(name, value2, options);
|
|
491
492
|
} else {
|
|
@@ -498,7 +499,7 @@ var __StackClientAppImplIncomplete = class __StackClientAppImplIncomplete {
|
|
|
498
499
|
const value = refreshToken && updatedAt ? this._formatRefreshCookieValue(refreshToken, updatedAt) : null;
|
|
499
500
|
await setCookie(domain.data, value);
|
|
500
501
|
const isSecure = await (0, import_cookie.isSecure)();
|
|
501
|
-
await (0, import_cookie.setOrDeleteCookie)(this._getRefreshTokenDefaultCookieNameForSecure(isSecure), null);
|
|
502
|
+
await (0, import_cookie.setOrDeleteCookie)(this._getRefreshTokenDefaultCookieNameForSecure(isSecure), null, cookieOptions);
|
|
502
503
|
});
|
|
503
504
|
}
|
|
504
505
|
async _getTrustedParentDomain(currentDomain) {
|
|
@@ -550,7 +551,7 @@ var __StackClientAppImplIncomplete = class __StackClientAppImplIncomplete {
|
|
|
550
551
|
);
|
|
551
552
|
(0, import_cookie.setOrDeleteCookieClient)(defaultName, refreshCookieValue, { maxAge: 60 * 60 * 24 * 365, secure });
|
|
552
553
|
(0, import_cookie.setOrDeleteCookieClient)(this._accessTokenCookieName, accessTokenPayload, { maxAge: 60 * 60 * 24 });
|
|
553
|
-
cookieNamesToDelete.forEach((name) => (0, import_cookie.deleteCookieClient)(name));
|
|
554
|
+
cookieNamesToDelete.forEach((name) => (0, import_cookie.deleteCookieClient)(name, {}));
|
|
554
555
|
this._queueCustomRefreshCookieUpdate(refreshToken, updatedAt, "browser");
|
|
555
556
|
hasSucceededInWriting = true;
|
|
556
557
|
} catch (e) {
|
|
@@ -594,7 +595,7 @@ var __StackClientAppImplIncomplete = class __StackClientAppImplIncomplete {
|
|
|
594
595
|
if (cookieNamesToDelete.length > 0) {
|
|
595
596
|
await Promise.all(
|
|
596
597
|
cookieNamesToDelete.map(
|
|
597
|
-
(name) => (0, import_cookie.
|
|
598
|
+
(name) => (0, import_cookie.deleteCookie)(name, { noOpIfServerComponent: true })
|
|
598
599
|
)
|
|
599
600
|
);
|
|
600
601
|
}
|