Attempt to fix loginPageOrg undefined error

This commit is contained in:
Owen
2025-12-24 12:25:11 -05:00
parent b64e2e11db
commit c5ece144d0
3 changed files with 25 additions and 10 deletions

View File

@@ -618,6 +618,16 @@ hybridRouter.get(
) )
.limit(1); .limit(1);
if (!result) {
return response<LoginPage | null>(res, {
data: null,
success: true,
error: false,
message: "Login page not found",
status: HttpCode.OK
});
}
if ( if (
await checkExitNodeOrg( await checkExitNodeOrg(
remoteExitNode.exitNodeId, remoteExitNode.exitNodeId,
@@ -633,16 +643,6 @@ hybridRouter.get(
); );
} }
if (!result) {
return response<LoginPage | null>(res, {
data: null,
success: true,
error: false,
message: "Login page not found",
status: HttpCode.OK
});
}
return response<LoginPage>(res, { return response<LoginPage>(res, {
data: result.loginPage, data: result.loginPage,
success: true, success: true,

View File

@@ -40,6 +40,11 @@ async function query(orgId: string | undefined, fullDomain: string) {
eq(loginPage.loginPageId, loginPageOrg.loginPageId) eq(loginPage.loginPageId, loginPageOrg.loginPageId)
) )
.limit(1); .limit(1);
if (!res) {
return null;
}
return { return {
...res.loginPage, ...res.loginPage,
orgId: res.loginPageOrg.orgId orgId: res.loginPageOrg.orgId
@@ -65,6 +70,11 @@ async function query(orgId: string | undefined, fullDomain: string) {
) )
) )
.limit(1); .limit(1);
if (!res) {
return null;
}
return { return {
...res, ...res,
orgId: orgLink.orgId orgId: orgLink.orgId

View File

@@ -48,6 +48,11 @@ async function query(orgId: string) {
) )
) )
.limit(1); .limit(1);
if (!res) {
return null;
}
return { return {
...res, ...res,
orgId: orgLink.orgs.orgId, orgId: orgLink.orgs.orgId,