promote: uat → main (GRO-1509 OIDC accountLinking fix) #46

Merged
Scrubs McBarkley merged 110 commits from uat into main 2026-05-22 14:03:44 +00:00
Showing only changes of commit ea825dfdda - Show all commits
+8 -5
View File
@@ -46,7 +46,7 @@ const GROOMER: StaffRow = {
let staffLookupResult: StaffRow | null = null;
let managerFallbackResult: StaffRow | null = MANAGER;
let userLookupResult: { id: string; name: string | null; email: string | null } | null = null;
let insertedStaff: StaffRow | null = null;
let _insertedStaff: StaffRow | null = null;
vi.mock("../db", () => {
const makeTableProxy = (name: string) =>
@@ -88,7 +88,7 @@ vi.mock("../db", () => {
),
}),
}),
insert: (table: unknown) => ({
insert: (_table: unknown) => ({
values: (vals: Record<string, unknown>) => ({
returning: () => {
const newStaff: StaffRow = {
@@ -104,7 +104,7 @@ vi.mock("../db", () => {
createdAt: new Date(),
updatedAt: new Date(),
};
insertedStaff = newStaff;
_insertedStaff = newStaff;
return [newStaff];
},
}),
@@ -124,7 +124,7 @@ function resetMocks() {
staffLookupResult = null;
managerFallbackResult = MANAGER;
userLookupResult = null;
insertedStaff = null;
_insertedStaff = null;
}
/** Build a minimal Hono app with jwtPayload pre-set, then apply a middleware. */
@@ -134,7 +134,10 @@ function buildApp(
) {
const app = new Hono<AppEnv>();
app.use("*", async (c, next) => {
c.set("jwtPayload", { sub: staffLookupResult?.userId ?? "unknown-sub" });
c.set("jwtPayload", {
sub: userLookupResult?.id ?? staffLookupResult?.userId ?? "unknown-sub",
email: userLookupResult?.email,
});
await next();
});
app.use("*", middleware);