Include in hybrid

This commit is contained in:
Owen
2025-10-06 10:31:31 -07:00
parent 23f05d7f4e
commit 2c46a37a53

View File

@@ -33,7 +33,9 @@ import {
targets,
loginPage,
loginPageOrg,
LoginPage
LoginPage,
resourceHeaderAuth,
ResourceHeaderAuth
} from "@server/db";
import {
resources,
@@ -200,6 +202,7 @@ export type ResourceWithAuth = {
resource: Resource | null;
pincode: ResourcePincode | null;
password: ResourcePassword | null;
headerAuth: ResourceHeaderAuth | null;
};
export type UserSessionWithUser = {
@@ -478,6 +481,10 @@ hybridRouter.get(
resourcePassword,
eq(resourcePassword.resourceId, resources.resourceId)
)
.leftJoin(
resourceHeaderAuth,
eq(resourceHeaderAuth.resourceId, resources.resourceId)
)
.where(eq(resources.fullDomain, domain))
.limit(1);
@@ -509,7 +516,8 @@ hybridRouter.get(
const resourceWithAuth: ResourceWithAuth = {
resource: result.resources,
pincode: result.resourcePincode,
password: result.resourcePassword
password: result.resourcePassword,
headerAuth: result.resourceHeaderAuth
};
return response<ResourceWithAuth>(res, {