@getstrata/core 0.5.86 → 0.5.87
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
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# @getstrata/core changelog
|
|
2
2
|
|
|
3
|
+
## 0.5.87
|
|
4
|
+
|
|
5
|
+
- `AuthUserDirectory.hasActiveBrowserSession?(userId, issuedAt)` is optional. `SessionGuard` calls it after `session_valid_after` and rejects the HMAC cookie when it returns false so WorkHub can revoke a single browser session by deleting the `sessions` row.
|
|
6
|
+
|
|
3
7
|
## 0.5.86
|
|
4
8
|
|
|
5
9
|
- `createSessionCookieDetails()` returns the HMAC session header plus `issuedAt` / `ttlSeconds` so apps can persist Jetstream browser-session rows without changing the cookie format.
|
package/README.md
CHANGED
|
@@ -82,7 +82,7 @@ import type { Migration } from "@getstrata/core/database/migrations/types";
|
|
|
82
82
|
Package name: **`@getstrata/core`** (npm org [`@getstrata`](https://www.npmjs.com/org/getstrata)).
|
|
83
83
|
|
|
84
84
|
1. Add `NPM_TOKEN` to GitHub repository secrets.
|
|
85
|
-
2. Tag a release: `git tag v0.5.
|
|
85
|
+
2. Tag a release: `git tag v0.5.92 && git push origin v0.5.92`
|
|
86
86
|
3. [Release workflow](../../.github/workflows/release.yml) builds and runs `npm publish --access public`.
|
|
87
87
|
|
|
88
88
|
Previously published as `@eyk-workhub/framework@0.1.0`, deprecated in favor of this package.
|
|
@@ -9,5 +9,6 @@ interface AuthUserRecord {
|
|
|
9
9
|
interface AuthUserDirectory {
|
|
10
10
|
resolveUserFromToken(token: string): Promise<AuthUser | null>;
|
|
11
11
|
findByIdOrThrow(id: number): Promise<AuthUserRecord>;
|
|
12
|
+
hasActiveBrowserSession?(userId: number, issuedAt: number): Promise<boolean>;
|
|
12
13
|
}
|
|
13
14
|
export type { AuthUserDirectory, AuthUserRecord };
|
|
@@ -274,6 +274,12 @@ class SessionGuard {
|
|
|
274
274
|
if (isSessionInvalidated(session.issuedAt, user.session_valid_after)) {
|
|
275
275
|
return null;
|
|
276
276
|
}
|
|
277
|
+
if (typeof tokenService.hasActiveBrowserSession === "function") {
|
|
278
|
+
const active = await tokenService.hasActiveBrowserSession(session.userId, session.issuedAt);
|
|
279
|
+
if (!active) {
|
|
280
|
+
return null;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
277
283
|
return {
|
|
278
284
|
id: user.id,
|
|
279
285
|
role: user.role,
|