Auth flow refactor, project requests, and routing updates

- Add server-side auth token loader (auth.server.ts) with SSR cookie forwarding
- Add project-requests client for explicit/signal/existing issue dispatch
- Refactor auth layout and app layout for SSR auth gating
- Update auth-client and auth-provider for convex token flow
- Extend project-issue primitives with request result schema
- Wire projectIssues backend mutation for request handling
- Update slice-one page and project-workspace hook
- Adjust routes (remove unused), Caddy config, and env templates
This commit is contained in:
Miniputer
2026-07-27 18:47:43 +05:30
parent cc47007fa9
commit 1855735245
24 changed files with 340 additions and 108 deletions

View File

@@ -2,7 +2,7 @@ import { expo } from "@better-auth/expo";
import { env } from "@code/env/convex";
import { createClient } from "@convex-dev/better-auth";
import type { GenericCtx } from "@convex-dev/better-auth";
import { convex, crossDomain } from "@convex-dev/better-auth/plugins";
import { convex } from "@convex-dev/better-auth/plugins";
import { betterAuth } from "better-auth/minimal";
import { components } from "./_generated/api";
@@ -25,7 +25,6 @@ const createAuth = (ctx: GenericCtx<DataModel>) =>
},
plugins: [
expo(),
crossDomain({ siteUrl }),
convex({
authConfig,
jwksRotateOnTokenGenerationError: true,

View File

@@ -118,6 +118,18 @@ export const createFromSignal = mutation({
},
});
export const getForDispatch = query({
args: { issueId: v.id("projectIssues") },
handler: async (ctx, args) => {
const issue = await ctx.db.get("projectIssues", args.issueId);
if (!issue) {
return null;
}
await requireProjectMember(ctx, issue.projectId);
return { issueId: issue._id, projectId: issue.projectId };
},
});
export const begin = mutation({
args: { issueId: v.id("projectIssues") },
handler: async (ctx, args) => {