@frockbot/cloudflare 0.7.292 → 0.7.294
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.json +7 -7
- package/src/admin-identities.ts +7 -1
- package/src/gateway.ts +1 -0
- package/src/index.ts +18 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frockbot/cloudflare",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.294",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
"typecheck": "tsc --noEmit -p tsconfig.json && tsc --noEmit -p tsconfig.access.json && tsc --noEmit -p test/tsconfig.json && tsc --noEmit -p e2e/tsconfig.json"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@frockbot/app": "0.7.
|
|
27
|
-
"@frockbot/applets": "0.7.
|
|
28
|
-
"@frockbot/computer": "0.7.
|
|
29
|
-
"@frockbot/core": "0.7.
|
|
30
|
-
"@frockbot/frock-compose": "0.7.
|
|
31
|
-
"@frockbot/providers": "0.7.
|
|
26
|
+
"@frockbot/app": "0.7.294",
|
|
27
|
+
"@frockbot/applets": "0.7.294",
|
|
28
|
+
"@frockbot/computer": "0.7.294",
|
|
29
|
+
"@frockbot/core": "0.7.294",
|
|
30
|
+
"@frockbot/frock-compose": "0.7.294",
|
|
31
|
+
"@frockbot/providers": "0.7.294",
|
|
32
32
|
"@rive-app/flutter-native-wasm": "44.0.0",
|
|
33
33
|
"agents": "0.24.0",
|
|
34
34
|
"ai": "^7.0.107",
|
package/src/admin-identities.ts
CHANGED
|
@@ -8,6 +8,8 @@ export const DEVELOPMENT_USER_ID = "development";
|
|
|
8
8
|
export interface GatewayIdentityV1 {
|
|
9
9
|
id: string;
|
|
10
10
|
email?: string;
|
|
11
|
+
/** Whether the provider verified `email`; an unverified one names nobody. */
|
|
12
|
+
emailVerified?: boolean;
|
|
11
13
|
mode: "better-auth" | "development";
|
|
12
14
|
}
|
|
13
15
|
|
|
@@ -19,7 +21,11 @@ export function isDeploymentAdminV1(
|
|
|
19
21
|
return true;
|
|
20
22
|
}
|
|
21
23
|
const emails = adminEmailsV1(configuredEmails);
|
|
22
|
-
if (
|
|
24
|
+
if (
|
|
25
|
+
identity.emailVerified === true &&
|
|
26
|
+
identity.email &&
|
|
27
|
+
emails.has(identity.email.trim().toLowerCase())
|
|
28
|
+
) {
|
|
23
29
|
return true;
|
|
24
30
|
}
|
|
25
31
|
return identity.mode === "development" && emails.size === 0;
|
package/src/gateway.ts
CHANGED
|
@@ -432,6 +432,7 @@ async function identifyRequest(
|
|
|
432
432
|
{
|
|
433
433
|
id: userId,
|
|
434
434
|
...(session?.user.email ? { email: session.user.email } : {}),
|
|
435
|
+
emailVerified: session?.user.emailVerified === true,
|
|
435
436
|
mode: development.userId ? "development" : "better-auth",
|
|
436
437
|
},
|
|
437
438
|
dependencies.adminEmails,
|
package/src/index.ts
CHANGED
|
@@ -441,7 +441,12 @@ function debugSurface(env: Env): DebugGatewaySurface {
|
|
|
441
441
|
return (
|
|
442
442
|
identity != null &&
|
|
443
443
|
isDeploymentAdminV1(
|
|
444
|
-
{
|
|
444
|
+
{
|
|
445
|
+
id: identity.id,
|
|
446
|
+
email: identity.email,
|
|
447
|
+
emailVerified: identity.emailVerified,
|
|
448
|
+
mode: "better-auth",
|
|
449
|
+
},
|
|
445
450
|
env.FROCKBOT_ADMIN_EMAILS,
|
|
446
451
|
)
|
|
447
452
|
);
|
|
@@ -849,7 +854,12 @@ async function storedAdmissionIdentity(
|
|
|
849
854
|
...(email === undefined ? {} : { email }),
|
|
850
855
|
emailVerified: identity.emailVerified,
|
|
851
856
|
isAdmin: isDeploymentAdminV1(
|
|
852
|
-
{
|
|
857
|
+
{
|
|
858
|
+
id: identity.id,
|
|
859
|
+
email: identity.email,
|
|
860
|
+
emailVerified: identity.emailVerified,
|
|
861
|
+
mode: "better-auth",
|
|
862
|
+
},
|
|
853
863
|
env.FROCKBOT_ADMIN_EMAILS,
|
|
854
864
|
),
|
|
855
865
|
};
|
|
@@ -914,7 +924,12 @@ async function mayCreateIdentity(
|
|
|
914
924
|
if (email === undefined) return false;
|
|
915
925
|
if (
|
|
916
926
|
isDeploymentAdminV1(
|
|
917
|
-
{
|
|
927
|
+
{
|
|
928
|
+
id: email,
|
|
929
|
+
email,
|
|
930
|
+
emailVerified: candidate.emailVerified,
|
|
931
|
+
mode: "better-auth",
|
|
932
|
+
},
|
|
918
933
|
env.FROCKBOT_ADMIN_EMAILS,
|
|
919
934
|
)
|
|
920
935
|
) {
|