mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-02 00:36:38 +00:00
always check rules even if auth is disabled
This commit is contained in:
@@ -142,16 +142,6 @@ export async function verifyResourceSession(
|
|||||||
return notAllowed(res);
|
return notAllowed(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
|
||||||
!resource.sso &&
|
|
||||||
!pincode &&
|
|
||||||
!password &&
|
|
||||||
!resource.emailWhitelistEnabled
|
|
||||||
) {
|
|
||||||
logger.debug("Resource allowed because no auth");
|
|
||||||
return allowed(res);
|
|
||||||
}
|
|
||||||
|
|
||||||
// check the rules
|
// check the rules
|
||||||
if (resource.applyRules) {
|
if (resource.applyRules) {
|
||||||
const action = await checkRules(
|
const action = await checkRules(
|
||||||
@@ -171,6 +161,16 @@ export async function verifyResourceSession(
|
|||||||
// otherwise its undefined and we pass
|
// otherwise its undefined and we pass
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
!resource.sso &&
|
||||||
|
!pincode &&
|
||||||
|
!password &&
|
||||||
|
!resource.emailWhitelistEnabled
|
||||||
|
) {
|
||||||
|
logger.debug("Resource allowed because no auth");
|
||||||
|
return allowed(res);
|
||||||
|
}
|
||||||
|
|
||||||
const redirectUrl = `${config.getRawConfig().app.dashboard_url}/auth/resource/${encodeURIComponent(
|
const redirectUrl = `${config.getRawConfig().app.dashboard_url}/auth/resource/${encodeURIComponent(
|
||||||
resource.resourceId
|
resource.resourceId
|
||||||
)}?redirect=${encodeURIComponent(originalRequestURL)}`;
|
)}?redirect=${encodeURIComponent(originalRequestURL)}`;
|
||||||
|
|||||||
Reference in New Issue
Block a user