mirror of
https://github.com/fosrl/pangolin.git
synced 2026-06-07 08:08:55 +00:00
Fix types
This commit is contained in:
@@ -17,6 +17,9 @@ import {
|
|||||||
ResourceHeaderAuthExtendedCompatibility,
|
ResourceHeaderAuthExtendedCompatibility,
|
||||||
ResourcePassword,
|
ResourcePassword,
|
||||||
ResourcePincode,
|
ResourcePincode,
|
||||||
|
ResourcePolicyPincode,
|
||||||
|
ResourcePolicyPassword,
|
||||||
|
ResourcePolicyHeaderAuth,
|
||||||
ResourceRule
|
ResourceRule
|
||||||
} from "@server/db";
|
} from "@server/db";
|
||||||
import config from "@server/lib/config";
|
import config from "@server/lib/config";
|
||||||
@@ -134,9 +137,12 @@ export async function verifyResourceSession(
|
|||||||
let resourceData:
|
let resourceData:
|
||||||
| {
|
| {
|
||||||
resource: Resource | null;
|
resource: Resource | null;
|
||||||
pincode: ResourcePincode | null;
|
pincode: ResourcePincode | ResourcePolicyPincode | null;
|
||||||
password: ResourcePassword | null;
|
password: ResourcePassword | ResourcePolicyPassword | null;
|
||||||
headerAuth: ResourceHeaderAuth | null;
|
headerAuth:
|
||||||
|
| ResourceHeaderAuth
|
||||||
|
| ResourcePolicyHeaderAuth
|
||||||
|
| null;
|
||||||
headerAuthExtendedCompatibility: ResourceHeaderAuthExtendedCompatibility | null;
|
headerAuthExtendedCompatibility: ResourceHeaderAuthExtendedCompatibility | null;
|
||||||
org: Org;
|
org: Org;
|
||||||
}
|
}
|
||||||
@@ -577,7 +583,11 @@ export async function verifyResourceSession(
|
|||||||
return notAllowed(res, redirectPath, resource.orgId);
|
return notAllowed(res, redirectPath, resource.orgId);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pincode && resourceSession.pincodeId) {
|
if (
|
||||||
|
pincode &&
|
||||||
|
(resourceSession.pincodeId ||
|
||||||
|
resourceSession.policyPincodeId)
|
||||||
|
) {
|
||||||
logger.debug(
|
logger.debug(
|
||||||
"Resource allowed because pincode session is valid"
|
"Resource allowed because pincode session is valid"
|
||||||
);
|
);
|
||||||
@@ -596,7 +606,11 @@ export async function verifyResourceSession(
|
|||||||
return allowed(res, undefined, dontStripSession);
|
return allowed(res, undefined, dontStripSession);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (password && resourceSession.passwordId) {
|
if (
|
||||||
|
password &&
|
||||||
|
(resourceSession.passwordId ||
|
||||||
|
resourceSession.policyPasswordId)
|
||||||
|
) {
|
||||||
logger.debug(
|
logger.debug(
|
||||||
"Resource allowed because password session is valid"
|
"Resource allowed because password session is valid"
|
||||||
);
|
);
|
||||||
@@ -617,7 +631,8 @@ export async function verifyResourceSession(
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
resource.emailWhitelistEnabled &&
|
resource.emailWhitelistEnabled &&
|
||||||
resourceSession.whitelistId
|
(resourceSession.whitelistId ||
|
||||||
|
resourceSession.policyWhitelistId)
|
||||||
) {
|
) {
|
||||||
logger.debug(
|
logger.debug(
|
||||||
"Resource allowed because whitelist session is valid"
|
"Resource allowed because whitelist session is valid"
|
||||||
|
|||||||
Reference in New Issue
Block a user