kitcn 0.12.18 → 0.12.19
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/dist/aggregate/index.d.ts +1 -1
- package/dist/{api-entry-BckXqaLb.js → api-entry-BMCQSsCw.js} +6 -1
- package/dist/auth/generated/index.d.ts +1 -1
- package/dist/auth/index.d.ts +13 -13
- package/dist/auth/index.js +1 -1
- package/dist/auth/nextjs/index.d.ts +1 -1
- package/dist/{backend-core-CGjsBIOp.mjs → backend-core-C0uwGXLx.mjs} +107 -14
- package/dist/{builder-Bh18Y2t0.js → builder-Cb6gloDB.js} +160 -6
- package/dist/cli.mjs +1 -1
- package/dist/{context-utils-HPC5nXzx.d.ts → context-utils-BvWW0Ilq.d.ts} +8 -1
- package/dist/crpc/index.d.ts +2 -2
- package/dist/{generated-contract-disabled-Dzx2IRId.d.ts → generated-contract-disabled-UsFjh8jz.d.ts} +30 -30
- package/dist/{http-types-BS63Nsug.d.ts → http-types-BLFA9zS7.d.ts} +2 -1
- package/dist/{middleware-C5P1Q29c.js → middleware-DkIhQXwg.js} +1 -1
- package/dist/{middleware-CU0mDiRs.d.ts → middleware-nS_qXecO.d.ts} +1 -1
- package/dist/orm/index.d.ts +1 -1
- package/dist/plugins/index.d.ts +1 -1
- package/dist/plugins/index.js +1 -1
- package/dist/{procedure-caller-DL0Ubgky.js → procedure-caller-AjLfkHyF.js} +1 -1
- package/dist/{procedure-caller-DloN1DNv.d.ts → procedure-name-D-fDCBlo.d.ts} +28 -128
- package/dist/ratelimit/index.d.ts +2 -2
- package/dist/ratelimit/index.js +3 -3
- package/dist/rsc/index.d.ts +3 -3
- package/dist/server/index.d.ts +5 -5
- package/dist/server/index.js +4 -4
- package/dist/{types-DrB2VeNb.d.ts → types-C6pQrnzD.d.ts} +1 -1
- package/dist/{types-BqUIoMfT.d.ts → types-a-RHmrDZ.d.ts} +9 -1
- package/dist/watcher.mjs +12 -9
- package/dist/{where-clause-compiler-Dw3EVdi6.d.ts → where-clause-compiler-CuH2JNxb.d.ts} +30 -30
- package/package.json +1 -1
- package/skills/convex/SKILL.md +5 -4
- package/skills/convex/references/features/auth-organizations.md +7 -2
|
@@ -11,7 +11,7 @@ See [Better Auth Organization Plugin](https://www.better-auth.com/docs/plugins/o
|
|
|
11
11
|
```ts
|
|
12
12
|
// convex/functions/auth.ts
|
|
13
13
|
import { organization } from "better-auth/plugins";
|
|
14
|
-
import
|
|
14
|
+
import { requireSchedulerCtx } from "kitcn/server";
|
|
15
15
|
import { defineAuth } from "./generated/auth";
|
|
16
16
|
|
|
17
17
|
export default defineAuth((ctx) => ({
|
|
@@ -28,12 +28,13 @@ export default defineAuth((ctx) => ({
|
|
|
28
28
|
invitationExpiresIn: 48 * 60 * 60, // 48 hours
|
|
29
29
|
teams: { enabled: true, maximumTeams: 10 },
|
|
30
30
|
sendInvitationEmail: async (data) => {
|
|
31
|
+
const schedulerCtx = requireSchedulerCtx(ctx);
|
|
31
32
|
const inviterName = data.inviter.user.name || "Team Admin";
|
|
32
33
|
const organizationName = data.organization.name;
|
|
33
34
|
const roleSuffix = data.role ? ` as ${data.role}` : "";
|
|
34
35
|
const acceptUrl = `${process.env.SITE_URL!}/w/${data.organization.slug}?invite=${data.id}`;
|
|
35
36
|
|
|
36
|
-
await
|
|
37
|
+
await schedulerCtx.scheduler.runAfter(
|
|
37
38
|
0,
|
|
38
39
|
internal.plugins.email.sendTemplatedEmail,
|
|
39
40
|
{
|
|
@@ -51,6 +52,10 @@ export default defineAuth((ctx) => ({
|
|
|
51
52
|
}));
|
|
52
53
|
```
|
|
53
54
|
|
|
55
|
+
`sendInvitationEmail` can run from mutation-driven auth flows. Use
|
|
56
|
+
`requireSchedulerCtx(ctx)` when you need scheduling. Do not narrow to
|
|
57
|
+
`ActionCtx` unless the callback truly runs only inside an action.
|
|
58
|
+
|
|
54
59
|
## Client Config
|
|
55
60
|
|
|
56
61
|
```ts
|