Files
buzz-sheet/app/api/profile/sync/route.ts
T
gunshiz 4b16941e11
CI / Verify (push) Successful in 1m31s
CI / Build immutable images and deploy (push) Successful in 2m16s
fix(auth) : keep Guide sessions beyond Sudloh token expiry
2026-10-06 18:00:42 +07:00

14 lines
593 B
TypeScript

import { getCustomerSession } from "@/lib/auth/server";
import { refreshLinkedSudlohProfile } from "@/lib/auth/sudloh";
import { errorResponse, HttpError, requireSameOrigin } from "@/lib/security/http";
export async function POST(request: Request) {
try {
requireSameOrigin(request);
const session = await getCustomerSession();
if (!session) throw new HttpError(401, "unauthorized");
await refreshLinkedSudlohProfile(session.user.id);
return Response.json({ ok: true }, { headers: { "Cache-Control": "no-store" } });
} catch (cause) { return errorResponse(cause); }
}