@jskit-ai/auth-core 0.1.31 → 0.1.33
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/package.descriptor.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export default Object.freeze({
|
|
2
2
|
"packageVersion": 1,
|
|
3
3
|
"packageId": "@jskit-ai/auth-core",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.33",
|
|
5
5
|
"kind": "runtime",
|
|
6
6
|
"dependsOn": [
|
|
7
7
|
"@jskit-ai/value-app-config-shared"
|
|
@@ -69,7 +69,7 @@ export default Object.freeze({
|
|
|
69
69
|
"mutations": {
|
|
70
70
|
"dependencies": {
|
|
71
71
|
"runtime": {
|
|
72
|
-
"@jskit-ai/kernel": "0.1.
|
|
72
|
+
"@jskit-ai/kernel": "0.1.34",
|
|
73
73
|
"@fastify/cookie": "^11.0.2",
|
|
74
74
|
"@fastify/csrf-protection": "^7.1.0",
|
|
75
75
|
"@fastify/rate-limit": "^10.3.0"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jskit-ai/auth-core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.33",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "node --test"
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"./shared/commands/authSessionReadCommand": "./src/shared/commands/authSessionReadCommand.js"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@jskit-ai/kernel": "0.1.
|
|
46
|
+
"@jskit-ai/kernel": "0.1.34",
|
|
47
47
|
"@fastify/cookie": "^11.0.2",
|
|
48
48
|
"@fastify/csrf-protection": "^7.1.0",
|
|
49
49
|
"@fastify/rate-limit": "^10.3.0",
|
|
@@ -9,13 +9,13 @@ function createAuthRouteVisibilityResolver() {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
const actor = context?.actor || request?.user || null;
|
|
12
|
-
const
|
|
13
|
-
if (
|
|
12
|
+
const userId = normalizeOpaqueId(actor?.id);
|
|
13
|
+
if (userId == null) {
|
|
14
14
|
return {};
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
return {
|
|
18
|
-
|
|
18
|
+
userId,
|
|
19
19
|
requiresActorScope: true
|
|
20
20
|
};
|
|
21
21
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { normalizeRecordId } from "@jskit-ai/kernel/shared/support/normalize";
|
|
2
|
+
|
|
1
3
|
function resolveMembershipRoleId(membershipLike) {
|
|
2
4
|
return String(membershipLike?.roleSid || "").trim();
|
|
3
5
|
}
|
|
@@ -36,10 +38,10 @@ function createMembershipIndexes(memberships) {
|
|
|
36
38
|
const bySlug = new Map();
|
|
37
39
|
|
|
38
40
|
for (const membership of memberships) {
|
|
39
|
-
const workspaceId =
|
|
41
|
+
const workspaceId = normalizeRecordId(membership?.id, { fallback: null });
|
|
40
42
|
const workspaceSlug = String(membership?.slug || "").trim();
|
|
41
43
|
|
|
42
|
-
if (
|
|
44
|
+
if (workspaceId) {
|
|
43
45
|
byId.set(workspaceId, membership);
|
|
44
46
|
}
|
|
45
47
|
if (workspaceSlug) {
|