Unified · Split
| @@ -46,12 +46,16 @@ export const create = organizationMutation({ · 45 unmodified lines | ||
| 46 | 46 | expiresInDays: v.optional(v.number()), |
| 47 | 47 | }, |
| 48 | 48 | handler: async (ctx, args) => { |
| 49 | + if (!workosEnabled) { | |
| 50 | + throw new Error("Invites require WorkOS auth to be enabled"); | |
| 51 | + } | |
| 52 | + | |
| 49 | 53 | const now = Date.now(); |
| 50 | 54 | const expiresAt = now + (args.expiresInDays ?? 7) * 24 * 60 * 60 * 1000; |
| 51 | 55 | |
| 52 | 56 | const token = `invite_${crypto.randomUUID()}`; |
| 53 | 57 | const tokenHash = await sha256Hex(token); |
| 54 | − const provider = workosEnabled ? "workos" : "local"; | |
| 58 | + const provider = "workos"; | |
| 55 | 59 | |
| 56 | 60 | const inviteId = await ctx.db.insert("invites", { |
| 57 | 61 | organizationId: ctx.organizationId, |